I have an issue. I'm currently working on my game and doing some early movement animations work. I was trying to animate attack but animation is playing only if I hold the space button. If I just press it, it plays only the first frame. I tried many solutions but they didn't work. Maybe you can help me? I'm using this script (I don't really remember it but I hope you'll understand)
Elif Input.is_action_pressed("ui_accept"):
if attackAnimation==1:
$AnimationPlayer.play("attack1")
attackAnimation=2
Elif attackAnimation==2:
$AnimationPlayer.play("attack2")
attackAnimation=1