38 lines
874 B
GDScript
38 lines
874 B
GDScript
extends Node3D
|
|
|
|
@onready var animation: AnimationNodeStateMachinePlayback = $AnimationTree.get("parameters/playback")
|
|
|
|
|
|
|
|
signal anim_check_grab(position: Vector3)
|
|
|
|
var pickup_animation_in_progress = false
|
|
signal pickup_animation_finished
|
|
|
|
func idle_empty():
|
|
animation.travel("IdleEmpty")
|
|
|
|
func walk_empty():
|
|
animation.travel("WalkEmpty")
|
|
|
|
func walk_hold():
|
|
if pickup_animation_in_progress:
|
|
await pickup_animation_finished
|
|
animation.travel("WalkHold")
|
|
|
|
func pickup():
|
|
pickup_animation_in_progress = true
|
|
animation.travel("Pickup")
|
|
|
|
func idle_hold():
|
|
if pickup_animation_in_progress:
|
|
await pickup_animation_finished
|
|
animation.travel("IdleHold")
|
|
|
|
func animation_key_grab():
|
|
emit_signal("anim_check_grab", $GrabPointLocation.global_transform)
|
|
|
|
func animation_key_pickup_completed():
|
|
pickup_animation_in_progress = false
|
|
emit_signal("pickup_animation_finished")
|