0
\$\begingroup\$

I'm relatively new to unity, started a couple weeks ago and so far I managed to setup a character with multiple parts, like hair, head, and body. Here's how it looks like:

alt

I also managed to import some animation thanks to https://www.mixamo.com/ and everything works perfectly well; for now...

Now, I'm struggling with the "change" part mecanism. I'd like to swap the "nude" body mesh part, to an "armor" mesh or any other body mesh. Problem is, when I change the model in the SkinnedMeshRenderer it tells me the following:

enter image description here

with this result: enter image description here

I did some reseach about this error message, and it actually makes sense, the given mesh doesn't have any bone setup, bone weights or such.

I would like to know if it's possible to use "common" skeleton for every models and assign it throught code?

\$\endgroup\$
6
  • \$\begingroup\$ It is possible, but for any part that needs to deform (like bending arms and legs), all your substitute meshes have to have skinning weights set to work with the same skeleton as your base mesh. \$\endgroup\$ Commented Jan 9, 2021 at 14:26
  • \$\begingroup\$ Thanks for your comment. Do you think it's possible to assign the weights to my mesh using the base mesh bone weights then? \$\endgroup\$ Commented Jan 9, 2021 at 15:26
  • \$\begingroup\$ Anything computable is possible, but that sounds like probably not what you want. Especially if you have hard armor pieces, you'll want to weight them differently so that a metal plate doesn't bend in the middle the way a cloth sleeve does. \$\endgroup\$ Commented Jan 9, 2021 at 15:27
  • \$\begingroup\$ I understand what you mean. The models i'm using are single pieces and don't have this type of constraints. I'm going to look the Unity API to see how I can set bone weights to my mesh. \$\endgroup\$ Commented Jan 9, 2021 at 17:51
  • \$\begingroup\$ Did you consider simply parenting these rigid pieces to the bone transforms, then? \$\endgroup\$ Commented Jan 9, 2021 at 17:59

0

You must log in to answer this question.