Pause/unpause animation in AnimationTree

Godot Version

Godot 4.2.1

Question

I need to pause my game, including animation of course. I tried setting AnimationTree to inactive, but that causes a problem: the animaiton is paused, but reactivating the AnimationTree doesnt continue the animation. The character freezes until another animation is played.
Any idea about how can I pause and restore the animation when using AnimationTrees?

Are you using get_tree().paused = true?

No, I think that would pause everything, including input. I just want to pause the game, not the ui and everything else.

You can set specific things like UI to not be paused with Process Mode “Always”. I would highly recommend using get_tree().paused for this feature.