If you are using an AnimationPlayer
to change the frame of a Sprite
, you can easily check which frame the Sprite
is on using its frame
attribute.
For example:
if anim_player.current_animation == "fire" and sprite.frame in [4, 5]:
if Input.is_action_just_pressed("attack"):
# do something
pass
This is probably easier than building function calls into your animations to change bools.