I’m investigating the interaction between offset root node and pose search. Specifically for turn on the spot animations. I know that in the Game Anim Sample this is solved. But we cannot make the capsule rotate instantly due to other game dependencies. So I’m looking into fixing this in different ways.
My main idea is to use offset root. What we have at the moment is:
- We register input and a start animation begins, which uses offset root to avoid sliding
- Input stops, our start animation has played a couple frames. The capsule rotates fast so it’s ahead (2/3 of the way), the animation is about 1/3
- A turn on the spot anim is picked. However, I’m seeing inconsistencies in rewind debugger on the heading vectors of the trajectory.
The query debug draw seems to be based on my current animation root, rather than the direction that I wish to face. Which makes sense because when the query is built the pose history is used to find the root transform. Since offset root modifies the bone, it gets recorded in the history.
But this is a problem because now there is a mismatch between my trajectory and the query. So the animations that are picked never reach the full rotation I requested.
I found the bDefaultWithRootBone flag, which is not exposed on the trajectory feature channel. And it seems to be able to overcome this issue. The query perfectly aligns with my trajectory if I dont use offset root. However, if I use offset root bone the query shown in RDebugger seems to have an offset.
This offset I believe is due to FSearchContext::GetSampleRotationInternal still using RootSchemaBoneIdx even when SchemaOriginBoneIdx tells it to use the trajectory. However, I believe it could also be an issue with RD debug draw code, and not the runtime code. (could be both?)
What I see is that the further away trajectory samples, seem to overshoot by the root offset rotation amount, and as the animation catches up with the capsule, that error reduces.
My concern is that visually I cannot see any issues on the animation. And when new anims are selected, they seem to pick the correct frame for the given capsule trajectory.
But the RD is showing that the query may be wrong. I really want to trust the RD because it’s the only tool to see through pose search at the moment, so it’s a little concerning and I just want to verify.
I also know that flag is experimental and GASP uses Steering (I’m not fully sure I understand that second steering node btw). But perhaps you have any pointers on what is happening here.