• 2D
  • I have an AnimationPlayer working in main menu but not after game is started, what am I doing wrong?

Im making a UI where buttons slide in from the side and slide out again when going to the next scene. Every scene gets loaded and added to the tree with the slide in animation, after the previous scene is removed (queue_free()) from the tree (after it's slide out animation has finished).

For some reason when coming from inside the "game menu" (aka 'pause -> main menu' or 'pause -> settings') none of the animations actually play. I debugged and the animation player gets the call to play the correct animation but it still doesn't actually play. What could be the issue? Or could this be an underlying bug?

Scene setup:

Animation demo:

Animation code:

Runtime tree:

Output:

(Ignore the two first zeros in the output, they're not related)

Where and how are you calling the anim_in() method?

I think I figured it out in the meantime, stupid mistake of pausing the tree in the pause menu, then not unpausing when changing the scene to the menu...

Is there a better way to pause the game other than pausing the tree?

But just to answer your message, the anim_in() gets called in _ready()

Right, nodes that are meant to work in paused state(such as say a menu overlay) should have their pause mode set appropriately.