fix: manually bootstrap state machine after runtime script attachment

This commit is contained in:
2026-06-03 16:49:06 -04:00
parent 60091932bd
commit ea7169048f
+6
View File
@@ -101,6 +101,12 @@ func _build_player() -> void:
camera.position = Vector3(0, 1.7, -3)
player.add_child(camera)
# set_script() does NOT call _ready(); bootstrap manually after children are in place
if sm.has_method("_ready"):
sm._ready()
if player.has_method("_ready"):
player._ready()
func _build_ui() -> void:
var canvas := CanvasLayer.new()