classname StateMachine extends Node @export var initalstate = NodePath() @onready var CS…
- User
class_name StateMachine extends Node @export var inital_state = NodePath() @onready var CS = get_node(inital_state)
Called when the node enters the scene tree for the first time.
func _ready(): for child in get_children(): print(child) child.state_machine=self child.character=get_parent() child.animation=get_parent().get_node("VisualNode/AnimationPlayer")
Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta): pass میتونی مشکل این کد رو برام در بیاری
- Assistant
کد شما به نظر میرسد که یک ماشین وضعیت (StateMachine) در Godot میسازد و حالت اولیه را از یک NodePath مشخص میکند. در اینجا چند نکتهای که میتواند مشکلزا باشد و شما ممکن است بخواهید آنها را بررسی کنید آورده شده است: