Skip to content

Getting started

Getting Started

Pro Tip: Be sure to download the Export Templates! The Export Templates that come with Godot will not work with this Editor/Add-on. Please see Installing Export Templates for more information.

Dotnet users will also want to refer to for additional information and steps that are needed to make the Editor/Add-on work.

Running Lua for you first time:

extends Node

var lua: LuaAPI =

func _lua_print(message: String) -> void:

func _ready() -> void:
    lua.push_variant("print", _lua_print)
    lua.push_variant("message", "Hello lua!")

    # All builtin libraries are available to bind with. Use OS and IO at your own risk.
    lua.bind_libraries(["base", "table", "string"])

    # Most methods return a LuaError in case of an error
    var err: LuaError = lua.do_string("""
    for i=1,10,1 do
    function get_message()
        return "Hello gdScript!"
    if err is LuaError:
        print("ERROR %d: %s" % [err.type, err.message])

    var val = lua.pull_variant("get_message")
    if val is LuaError:
        print("ERROR %d: %s" % [val.type, val.message])

    var message =[])

Dotnet (mono) users see this example redone in C#