godot
godot copied to clipboard
Seek request in BlendTree causes jitter in root motion
Tested versions
- Reproducible in 4.3
System information
Godot v4.3.stable - Windows 10.0.19044 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3080 (NVIDIA; 32.0.15.6094) - AMD Ryzen 9 5950X 16-Core Processor (32 Threads)
Issue description
This report is intended as a companion to #95688, detailing problems with root motion in Godot 4.
When seek request is used in a BlendTree to control the starting position of a root motion animation, seeking upon state machine transition causes get_root_motion_position to supply an incorrect value.
For instance, if I have two idle animations, one with the left foot forward and another with the right foot forward, I need to be able to seek my move animation to either 0 (or -1), or 0.5, depending on which foot starts the animation.
When seeking to 0.5, the root motion position will snap my character back every single time.
https://github.com/user-attachments/assets/c321f524-2580-4571-9e48-67a685b65288
This is a regression from Godot 3, where with "seek" this never was an issue.
https://github.com/user-attachments/assets/de7a1168-2d09-4aa3-8952-1256e94d85e1
At the moment, the only way to nullify this is to forcibly include a oneshot within the BlendTree that "leads in" the seeked node after transition. Even though there is no crossfading or interaction with the seek beforehand, if the seek is the first thing that happens in this particular BlendTree after transition, the snapping will always occur.
https://github.com/user-attachments/assets/2cc92c7d-031b-4d8f-8791-11fa4916a4cd
Even though you can plainly see the cut in the animation where the oneshot > transitions to a walk cycle, the position doesn't snap in this case. However, if the oneshot wasn't at the start of my "walk" blendtree but at the end of my "idle" blendtree, root motion position would snap me every time. This really limits how I can structure my state machine.
Changing callback modes also has no effect. Changing the reset property on the transition does nothing.
Steps to reproduce
- Open MRP
- Each alternate step you take with WASD will be seeked to 0.5.
- Observe the floor grid to see root position jittering.
- The red line shows that for 1 frame, the character's root motion velocity is in the opposite direction.