gfolf2/src/characters/character_controller.gd

19 lines
452 B
GDScript3
Raw Normal View History

class_name CharacterController extends Node3D
## Controller class for character animations
@onready var animation_tree: AnimationTree = $AnimationTree
@onready
var animation_state: AnimationNodeStateMachinePlayback = animation_tree["parameters/playback"]
func reset() -> void:
animation_state.start("stand_to_idle")
func start_upswing() -> void:
animation_state.travel("upswing")
func downswing() -> void:
animation_state.travel("downswing")