I am building a 2d top down pixel rpg in godot using AnimatedSprite2D node. When I press e an attack animation happens. But if you press e while running, the attack animation gets cancelled by the walking animation. I want to make it so that whenever the e key is pressed, the player can't move anymore and other animations get cancelled other than the attacking animation.
I tried to make a timer that lasted as long as the attack animation, which is 60 milliseconds. It would activate if the e key was pressed, and it would then turn some variables that were needed for animation and movement to false. However it did not work. i Seached a tutorial where they were using a AnimationPlayer node, however it requires a sprite2D node instead of AnimatedSprite2D. Do you maybe know a function that could help me here? If this doesnt work, i will continue with the game, and when i make a new one, i will use a AnimationPlayer node