Animations are not playing only if they have certain names

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By riftman

So for some reason if I’ve got an animation, in this case “Run” then the animation doesn’t play properly. The player sprite just disappears for a second at the beginning of the run cycle each time. However, if I duplicate the run animation in the animation player node, rename the copy to Run2 and replace all the references from “Run” in the code to “Run2” or any other name except “Run”, then it works perfectly.

Nothing, apart from the names of the animations within the animation player is different as they are just straight duplicates, but only “Run2” works properly.
This also happened with an attack animation that was originally just called “Attack” but was renamed to “NormalAttack” because the animation just wouldn’t play at all.
In editor all the animations play properly, but not in game.
There are also no errors within the debugger or anything.

look
print($AnimationPlayer.current_animation)

ramazan | 2022-08-29 10:08

The current animation names are showing correctly in the console, just going straight from idle to run, like it should. The issue is still there. Unless something strange is going on between transitions or at the beginning of only those specific animations, but nothing indicates this.
I’m checking out my script in its entirety more carefully now, because the animations work if AnimationPlayer.play() and the condition to see if the animation’s already playing are the only lines in the script but not when everything’s together.

riftman | 2022-08-29 19:40