37 lines
707 B
GDScript
37 lines
707 B
GDScript
extends Node3D
|
|
|
|
func _ready() -> void:
|
|
play_idle()
|
|
|
|
func play_idle() -> void:
|
|
$AnimationPlayer.stop()
|
|
$AnimationPlayer.play("idle")
|
|
|
|
|
|
func play_think_walk() -> void:
|
|
$AnimationPlayer.play("walk2")
|
|
|
|
func celebrate() -> void:
|
|
$AnimationPlayer.play("happy3")
|
|
|
|
func wave() -> void:
|
|
$AnimationPlayer.play("wave")
|
|
|
|
|
|
func stop_anim() -> void:
|
|
$AnimationPlayer.stop()
|
|
$AnimationPlayer.play("reset")
|
|
|
|
func play_small_celebration() -> void:
|
|
$AnimationPlayer.stop()
|
|
$AnimationPlayer.play("happy")
|
|
await get_tree().create_timer(0.7).timeout
|
|
stop_anim()
|
|
|
|
|
|
func _on_animation_player_animation_finished(anim_name: StringName) -> void:
|
|
if anim_name == 'jump':
|
|
pass
|
|
else:
|
|
$AnimationPlayer.play('idle')
|