Added animations

This commit is contained in:
2024-02-03 00:57:33 +01:00
parent d6843621ce
commit b815a6603c
3 changed files with 36 additions and 5 deletions

View File

@ -1,16 +1,23 @@
extends Node
@export var character: Character
@export var animation_player: AnimationPlayer
@export var blend_time: float
var next_animation: StringName = "RESET"
func _ready():
assert(character)
assert(animation_player)
assert(blend_time >= 0.0)
func _process(_delta):
play("idle")
if character.velocity.y > 0:
play("female/jump")
elif character.direction != Vector3.ZERO:
play("female/run")
else:
play("female/idle")
if animation_player.current_animation == next_animation:
return