Answered

Problem with Avatar Masks when using Child-Of Constraint.

Marco Amadei 4 years ago updated by Peter - Soxware Developer 4 years ago 1

Hello. I have a problem with Avatar Masks when using Child-Of Constraint.
Basically i have a "itemPos" transform on my haracter prefab, that I animated using UMotion. I need to pass weapons from an hand to another in some animations, and it works correctly using child-of constraint.
Problem is, I need to apply an Avatar Mask to animate only the upper part of the body, so my character can move while for example reloading. This gives me issues since itemPos got masked too, and I have no idea how to include it on the Avatar Mask. Thank you for helping me in advice.

Image 343

Image 344


UMotion Version:
1.22
Unity Version:
2019.3.0f6

Answer

Answer
Answered

Hi Marco,

thank you very much for your support request.

The transform list in in your avatar mask is created based on the avatar definition of your character. This avatar is created when Unity imports your character. That means that only bones/transforms that are present in your original character are added to the avatar mask. I guess you have created the "itemPos" transform later in Unity, thus it has not been available when Unity imported your character thus is not included in the avatar and thus it is not added to the avatar mask's transform list.

I see two ways you can overcome this:

1) If you are familiar with 3D modeling applications, add the "itemPos" transform to your character's model. Make sure to use the same name and the same local position/rotation (otherwise your existing animation won't work correctly). After re-import, re-create your avatar mask's transform list based on the new avatar.

2) You could also export your character that contains the "itemPos" transform from Unity to *.fbx using Unity's FBX Exporter (get it via Unity's Package Manager, the Asset Store version is outdated). Probably the easier method.


Please let me know in case you have any follow-up questions.


Best regards,

Peter

GOOD, I'M SATISFIED

Thank you for your really detailed answer.

Solution #1 was something I thought about, but I had some troubles since I have several different characters using a identical skeleton.
Solution #2 is interesting and probably I will go in that way.

But first I will try another way, changing literally by script the transform parent of 'itemPos', mapping the call of the function on the animation. If this will give me precision problems, i'll go with solution 2 for sure.

Thank you again!

Satisfaction mark by Marco Amadei 4 years ago
Answer
Answered

Hi Marco,

thank you very much for your support request.

The transform list in in your avatar mask is created based on the avatar definition of your character. This avatar is created when Unity imports your character. That means that only bones/transforms that are present in your original character are added to the avatar mask. I guess you have created the "itemPos" transform later in Unity, thus it has not been available when Unity imported your character thus is not included in the avatar and thus it is not added to the avatar mask's transform list.

I see two ways you can overcome this:

1) If you are familiar with 3D modeling applications, add the "itemPos" transform to your character's model. Make sure to use the same name and the same local position/rotation (otherwise your existing animation won't work correctly). After re-import, re-create your avatar mask's transform list based on the new avatar.

2) You could also export your character that contains the "itemPos" transform from Unity to *.fbx using Unity's FBX Exporter (get it via Unity's Package Manager, the Asset Store version is outdated). Probably the easier method.


Please let me know in case you have any follow-up questions.


Best regards,

Peter