state_name_displayer.gd 271 B

1234567891011121314
  1. extends Label
  2. var start_position = Vector2()
  3. func _ready():
  4. start_position = position
  5. func _physics_process(_delta):
  6. position = $"../BodyPivot".position + start_position
  7. func _on_StateMachine_state_changed(current_state):
  8. text = String(current_state.get_name())