So I am trying to make a three input game, where the player can press high, mid or low. My issue at the moment seems that when doing an input, everytime I press the next one it will skip the previous one and start playing the new animation. Is there a way to prevent that from happening?
extends CharacterBody2D
func _process(_delta):
if Input.is_action_pressed("high_1"):
$AnimationPlayer.play("high_attack")
if Input.is_action_pressed("mid_1"):
$AnimationPlayer.play("mid_attack")
if Input.is_action_pressed("low_1"):
$AnimationPlayer.play("low_attack")
$AnimatedSprite.play("Idle")
How would I use AnimationPlayer.queue() exactly? Would I just insert it below every $AnimationPlayer.play() and specify the timing or do I have to do something else, also $AnimationPlayer doesn’t have a playing function, do I use is_playing instead?
Just call $AnimationPlayer.queue("my_animation") and it will queue and play that animation after the current animation is finished.
Yes. It’s better to read the documentation to know what each function does and test it by yourself that to wait for someone else to give you the green light.