Hello!
I am trying to use root motion for this game that I am working on. I am making the animations myself in blender with Rigify. I move the root bone in blender and the animations look fine but when I export them to unity they move where the root is but the mesh deforms heavily. As you can see in the picture, the first part of the stretched mesh is the correct place after being moved by the root. (I did a test animation where nothing else moves but the root to try to diagnose the issue)
Is there someone who has encountered something like it before or knows something that could help me?
The rig exports with the MCH bones and the root which contains the DEF bones and when you have to choose which is the root bone you can only choose either, could this be part of the problem?
It kind of looks like the weights have been applied to the wrong bones. In the Unity scene you can try moving each to see what the weights are assigned to. No weights should be assigned to a MCH bones, only to the DEF bones. Another thing is that Unity by default only supports 4 bone weights which can make it look different than Blender sometimes.
Normally you want to avoid unnecessary bones when importing to Unity. When I use rigify I like to use another rig (like the meta rig) and use constraints to attach it to the rigify rig. Then on exporting the animation I bake the animations, delete rigify and only export the simple rig. A simple rig also lets you change the structure so you can make a rigify animation and export it to Unity as a humanoid rig without losing details like finger animations.
Yes seems like the MCH bones are affecting the mesh as well.
I was a fool and thought that clicking the “only deform bones” button would solve the issue for me but it didnt.
I tried doing what you told me and found much better results, I also tried the Game Rig Tools add on that did it for me too, I just had to use the Rigify Hierarchy Fix option!
A few days of headaches over this and I think its all good now so thank you!