I am using a Mixamo attack animation with my character. When I play the attack animation montage the character turns slightly to the left, and when the animation is complete it reverts back to the original rotation.
This only happens when the root motion is enabled. Can someone please help me out?
Models in Mixamo usually don’t have a ground anchored root bone. The bone with the highest hierarchy is hips in your case, right? If so, things might go wrong when the root motion is enabled. (Most of the time the animations get way more messed up than just getting slightly misaligned though)
Here’s a tutorial on adding a root bone to a Mixamo model:
Keep in mind that once that’s complete, you’d need to retarget all of your animations since they won’t work with the new skeletal mesh.
Yes I have already added a root bone to the animation using Mixamo Converter plugin in Blender and have also retargeted the anims. But still doesn’t seem to work.
My main character model is rigged using Accurig and I have retargeted the animations to the Accurig skeleton after adding the root bone.
I think there’s a reason you’re enabling the root motion on your attack animation. Can it be because you manually adjust the player’s location for the duration of the attack using blueprints? To double check, can you use the Play Animation node and trigger your attack animation that way? If the issue persists, please share the expected result (when the root motion is disabled) and the unexpected (when the root motion is enabled) by sending a video, along with the screenshots of the full blueprint code where you trigger the attack (please include the whole execution chain rather than a small part of it)
What happens when you just use the Play Animation node instead of playing a montage? Also, like I said, it would be helpful if you shared a video showing the expected and unexpected results, which for now seems like depends on the “enable root motion” setting.
Okay I tried using the Play Animation node, the character just tries to perform the attack while being locked to the same place with weird feet movement.
I want to send a recording but I guess it doesn’t allow newbies to post media here.
That’s definetly weird. Maybe the root bone’s rotation is off. Try adding the root bone manually by following the tutorial I’ve provided in my initial reply. Then make sure you retarget them correctly, you can also consider using a custom retargeter for that purpose. As for your character having weird feet movements that you mentioned previously, we should also make sure their IK rigs are retargeted properly. Here’s a tutorial on it:
Alright I got it. I was able to fix the issue by adding the root bone again on the Mixamo animations using the Blender addon but this time by turning off ‘Transfer Rotation’ and ‘Apply Rotation’ checkbox in the addon settings.
Then I reimported the animations in UE and retargeted again and it worked!!