fix: ensure player._ready() runs before MovementStateMachine._ready()

This commit is contained in:
2026-06-03 16:56:28 -04:00
parent c463c29031
commit 9c39d79696
+3 -2
View File
@@ -136,10 +136,11 @@ func _build_player() -> void:
player.add_child(camera) player.add_child(camera)
# set_script() does NOT call _ready(); bootstrap manually after children are in place # set_script() does NOT call _ready(); bootstrap manually after children are in place
if sm.has_method("_ready"): # IMPORTANT: player._ready() MUST run BEFORE sm._ready() so the machine has valid params
sm._ready()
if player.has_method("_ready"): if player.has_method("_ready"):
player._ready() player._ready()
if sm.has_method("_ready"):
sm._ready()
func _build_ui() -> void: func _build_ui() -> void: