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?
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.
I’ve only been working with AnimationNodeStateMachines, but here’s what I found to work:
var playback = (AnimationNodeStateMachinePlayback)AnimationTree.Get(“parameters/playback”);
playback.Stop();
// resume
playback.Play(“the name of the animation you just paused”)