Problem with Avatar Masks when using Child-Of Constraint.
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.
Answer
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
Customer support service by UserEcho
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