- Home /
Blender animation on rigged character not the same in Unity...
Hey. My issue here is a walking animation I made on a rigged humanoid in Blender that appeared to be working fine in Blender with all the clothing layers, but when I import it as an fbx or blend file in Unity there is a minor difference in how the animated rig affects the clothing in Unity. The only area affected is a little area around the knees as you can see.
I have done a few animations from Blender into Unity and not had this problem yet so I am at a bit of a loss as to what to do here.
Thanks!
Answer by meat5000 · Mar 06, 2018 at 10:30 AM
At that keyframe the cloth simply moves underneath the character mesh. You just need to fine tune it. Try adjusting the allowed error in the import options.
When you say the "allowed error" do you mean the options like position error found in the animation tab on the import settings? I've been playing about with things like anim.compression and the error values and have not seen any effect so far...
Ok, then these things need to be tweaked in Blender. Try adding more keyframes around the problem area so Unity has less to interpret.
Ok, I did a bit of tweaking in Blender and added a lot of keyframes into the walking animation with no effect. Although I have a new theory. Is it possible that Unity does not import the weight painting in Blender 100% accurately?
To me it looks like the parts of the mesh intersecting is because the paint strength on it is somehow different in Unity than in Blender, because weight painting this on Blender in this is what I struggled with most in this process, so it is just about ok working in Blender but maybe not in Unity.
Also could it be something to do with the fact that this animation uses foot I$$anonymous$$ movement?
I have not worked much with humanoid animations in Unity as you can probably tell.
Blender I$$anonymous$$ will not actually carry through to Unity. Its just a device in Blender to make animating easier. All that gets stripped out and the only thing thats important is the rig+weighting and $$anonymous$$eyframes. Unity will make its own interpretation of $$anonymous$$ost things. Even between keyframes it can end up handling things slightly differently.
If you find that rotations are not working correctly, often you need to check the Bone Axes; in particular to make sure the z-axis is pointing in the general direction of the bend motion e.g backwards out of the knees. You then need to recalculate the bone Roll for each subsequent bone calculated against the topmost parent of the limb. So you do legs, arms, fingers etc separately.
I can confirm that the Z axis for the knee area is faxing the right way, I aligned all my bones based on the front view axis so they are all facing that way.
When you say "recalculate the bone roll for each subsequent bone calculated against the topmost parent of the limb", do you mean that you need to have like a consistent bone roll for all the bones in the limb based off the top level bone yes? $$anonymous$$y upper and lower leg bones in both legs have the same bone roll. $$anonymous$$aybe I should play about with that and see if anything happens?
Answer by EoinTrainor11 · Mar 08, 2018 at 10:42 AM
I do have this working now but I'm not sure exactly how I did it. The thing that changed it was the Skinned Mesh Renderer Component, the quality on it needed to be set to 4. Other factors that I believe also influenced it was the Z axis direction of the bones on Blender as suggested and setting the animation compression off.
I think it just needed a bit of tinkering in a couple of areas but that's what I'd take a look at if you are stuck!