’m using root motion montages for attacks, and during the montage playback,
I want the character to continuously face the target by adjusting only the yaw rotation.
In this case, I do not want to use rotation animations or Motion Warping.
The montage handles movement via root motion, and I only want to adjust the facing direction toward the target during the playback using gameplay-side logic.
For context, I am already using Motion Warping for aligning both position and rotation when needed.
However, in this situation, I would like to achieve the rotation toward the target without relying on Motion Warping.
Here’s what I would like to know:
- What is the proper way to rotate a character toward the target (yaw only) during a root motion montage?
- If the animation does not include any rotation, can applying external yaw adjustments cause conflicts with the root motion location?
Thank you as always for your help.
Hi, sorry for the delay in following up on this issue. We’re working through the backlog after being out on break for the last couple of weeks.
Any modification of root motion in the way you described is likely going to involve a code based implementation. One option would just be to directly modify the root motion transform that is returned from the anim instance to the CMC to apply your desired rotation.
Another option could potentially be to create a custom FRootMotionSource class to do the work. The idea behind root motion sources is to allow a way to generate procedural root motion that can drive the location of the CMC. But currently, the CMC works either with animated root motion or root motion sources (you can have multiple via FRootMotionSourceGroup). So any custom root motion source would need to manually extract root motion from the current montage and then apply your procedural modifications on top.
You may also find that this conflicts with your use of motion warping, in which case the warping could also potentially be done within the root motion source. Or, alternatively, I think that in Fortnite we have a root motion source implementation that has been implemented to work while motion warping is active (I would need to investigate that further to see what it looks like).
I would also be interested to know why you don’t want to apply this rotation via motion warping?
Ok yeah, if you run into a situation in future that Motion Warping doesn’t allow you to solve then Root Motion Source is another option that you could look at. You could also just look at modifying the root motion directly on the Character Movement Component - if you look for where USkeletalMeshComponent::ConsumeRootMotion is called, you’ll see this in the CMC code.
I’ll close out this thread for now, but feel free to reopen it, or create a new one, if you want to discuss this in more detail in future.
I hope you had a pleasant and restful vacation.
We’re currently making active use of Motion Warping in our project. However, we raised this question because we believe there may be limitations in handling every scenario solely through Motion Warping.
If we could control the character’s rotation independently while using root motion-based animations, it would give us much more flexibility in how we approach various tasks.
Thank you for your detailed response. We’ll definitely keep your suggestions in mind when we move forward with implementing this in actual development.