How I can reset an animation tree to an arbitrary state, including root motion?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By newobject

Godot 4.0

My game has a “preview your move” system (think Yomi Hustle). I’m using 3d models with root motion animations. On a given frame (where the tree is likely in the middle of a variety of animation blends), I want to save the overall state of my player (a character body, animation tree, skeleton. and mesh), and be able to return the player to that exact state later. I’ve got this mostly working for the animation tree’s nodes states, however, a big missing piece is that the root motion gets screwed up by this time rewind. I haven’t found anyway to “restore” the state tracking the root motion.

I think the general form of my question is how to save and restore the precise state of animation tree, including root motion. I’ve kind of hacked the tree node state save/restore enough to mostly work, but root motion is totally fubar’d after a restore right now.

Thanks.

BTW: If there’s someone who’s very skilled in this area, I would be willing to discuss some paid work opportunity (as a one-off) to hammer out a working version of what i’ve described here.