Skip to content

No exact replacement for gdscript @onready ? #243

Description

@Goldenlion5648

I wanted to use lua instead of gdscript for this project, and before I was able to do

@onready var tiles_holder: Node3D = $tiles_holder

but since "@ onready" can not be used in lua, the best I was able to do was use get_node inside of _ready

local lua_testing = {
    extends = Node2D,
}
local first_child

function lua_testing:_ready()
    first_child = self:get_node("first")
    print(first_child)
end


return lua_testing

while this works, it is annoying to not be able to set the variable value at the top where I first declare first_child. Is there something I'm missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions