Skinned Mesh Renderer distorting model (Blender to Unity)
Hi devs. I am making a game with customisable options, so characters can have alternative 'skins'. The way I want to do this is by using one skinned mesh renderer for an armature, and simply swapping the mesh depending on the user's choice. This is so I can keep animations across one object.
I've just created an alternative skin for a character in Blender (using the exact same armature as my default one) and imported it into Unity. However when I replace the mesh for my original model with my new mesh, it becomes distorted and looks like this:
One thing to note is when I have this new model as a completly seperate object (so I drag it into the hierarchy with its own armature and mesh) it works fine and isn't distorted at all which makes me think it's something I've done wrong in Unity rather than Blender.
I also can't find anything about this and anything that could work simply doesn't. I've been looking into this for the last 8 hours now so getting a little frustrated. If anyone understands what's going on or needs extra details etc. I'd be happy to help! Thanks friends.
Answer by $$anonymous$$ · Jun 08, 2020 at 04:16 PM
For anyone who might come across this issue or if you (@Sgt_Spike) haven't solved this yet here is a possible cause and solution:
Cause: In blender when you create the original model, you probably (automatically) also assing weights to the model for that specific mesh-rig combination. When you then import the model into Unity and then assign a different mesh to the rig, you break the original mesh-rig weights, as the new mesh will be different from the original mesh and would need it's own weights.
Solution: Since you already have multiple meshes but want to reuse your rig, I would recommend to create multiple models in Blender with the correctly assigned weights. Then in Unity you let users just swap the whole model, instead of assigning meshes to the rig. This way you can apply the same animation(s) to any of these models, since they all use the same rig.
Hope this helps someone out there.
Your answer
Follow this Question
Related Questions
importing onto unity from blender problems 0 Answers
vertex Weight Problems 0 Answers
Skinned Mesh Renderer Mesh Attaches to the wrong gameobject(bone) despite identical Bone Order 0 Answers
Problem when changing mesh to SkinnedMeshRenderer 0 Answers
Applying cloth to a skinned mesh results in a strange behaviour? 0 Answers