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?
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.
I also noticed the absence of pause method on AnimationTree and AnimationNodeStateMachinePlayback, so I tried animation_tree.process_mode = Node.PROCESS_MODE_DISABLED and animation_tree.process_mode = Node.PROCESS_MODE_INHERIT. Is it what you meant by “setting AnimationTree to inactive”?
Because it worked in Godot 4.4.1: the animation continued instead of restarting.
Note: I’m using a State Machine with mostly isolated Animation nodes.