Deformation on Skinned Mesh Renderer when changing Mesh (same rig)

Hello,

I made an “Elf1” on blender and rigged him with mixamo.com and use it on my game.

I made an update for this model, named “Elf2” and rigged it on mixamo.
I also made another model, a dwarf and rigged it on mixamo.

I want to change “Mesh” on my “Skinned Mesh Rendere” with the new elf and dwarf (the last will be a variant of my prefab).
7875865--1001371--upload_2022-2-7_16-58-25.png

Unfortunately, “Elf2” is quite deformed and “Dwarf” is even worse.

Is there a way to swap MESH between model ? Because I made a lot of script in this humanoid, particulary on the rig (added some GameObject and Collider for ragdoll etc.) and can’t manually add them all on my dwarf. Worse, I don’t want to manually update everytime I update my elf model.

7875865--1001371--upload_2022-2-7_16-58-25.png

You can’t swap skeletal meshes easily.

Skeletal meshes rely on “bindposes” , to be deformed correctly, and when you swap model on skeletal mesh component, you need to ensure that both bindposes of Mesh and “bones” of skinned mesh renderer are set correctly.

If you want to have a “dwarf” using “elf” animation the easiest option is import them both as “HUmanoid” animation, and then use the same Animator Controller on both of them. This way models with different physique can use same animation set.

It’s the same rig but dwarf have some bones a little bit shorter.
I can easily use the same Animator Controller to make the same animation, it’s working. It’s just that I made a lot of modification inside the rig for ragdoll animation (adding a lot of collider).

So I must manually copy everything ?

If the dwarf bones are a bit shorter, it is not the same rig. And if you configure it correctly, it will not deform right.
And because you skin models in mixamo, it is highly likely Elf 1 and Elf 2 use different bindposes and that’s why they deform.

At some point unity introduced “Constraints”, and ragdoll can be implemented using them. Meaning you’ll have a separate set of objects forming a ragdoll, and copy conrotation from it on skeleton, but only when ragdoll is enabled.

No, it depends on what you’re trying to do.

Ideally you’d want to write a script that can auto-configure a ragdoll for you or create a process that streamlines creation of new characters.

The least painful option at the moment would be to use humanoid animation instead of trying to swap the mesh. It IS possible to make the mesh swap work, but it is not really a straightforward thing to do. And if you’re struggling with it, it will be easier to just make do with humanoid animation controllers.

ok thanks!