You are right, i misread the code.Maybe this helps.When _fixed_process() is called the first time, the 'if ..' is always true, no matter if a ui_accept is pressed or not. Let's say it's not pressed so anim gets set to "idle", anim_new is still set to "", so the if evaluates to true ("idle" != ""), so the "idle" animation plays and anim_new is set to anim.As long as ui_accept is not pressed the idle animation keeps playing, because "idle" != "idle" evaluates to false.If ui_accept is pressed, anim gets set to "run", so the if is again true ("run" != "idle") the run animation plays and anim_new is set to anim.As long as ui_accept is pressed, anim and anim_new will both be set to "run", the moment it's not pressed anim gets set to "idle" again but anim_new is still set to "run" so the if evaluates to true ("idle" != "run").Hopes that makes it clear, it could also help to add some print()'s to see what's going on.I guess what confused me was that anim_new is not the new animation but the current animation.