Added animations
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user