ft: nucleotide prey FSM

This commit is contained in:
2026-01-26 23:54:15 +01:00
parent c11afd9ddd
commit adf1438bc8
18 changed files with 121 additions and 45 deletions

View File

@@ -10,7 +10,7 @@ class_name StateMachine extends Node
# Connect states on ready, then wait.
func _ready() -> void:
for node: State in find_children("*", "State"):
node.finished.connect(_transition_to_next_state)
node.finished.connect(transition_to_next_state)
await owner.ready
state.enter("")
@@ -37,3 +37,6 @@ func _transition_to_next_state(target_path: String, data: Dictionary = {}) -> vo
state.exit()
state = get_node(target_path)
state.enter(previous_state_path, data)
func transition_to_next_state(target: int, data: Dictionary = {}) -> void:
push_error("Child FSM failed to implement transition function.")