First, the usual apologies if this has been asked somewhere already, and assurances that I haven’t been able to find it if it has. I’m trying to do something that I thought was supposed to be straightforward in Unity, and finding that it might not be quite as easy as I thought.
I have a few characters that use the same rig; some of the proportions are slightly different, but the joint names are all the same. I thought they were supposed to be able to share animations pretty easily.
I drag .anim files from one of these characters to another. In the animation window it appears to be assigned to the character; the keys and curves show up. However, all the joint names on the left-hand hierarchy turn yellow and the animation doesn’t play at all. When I switch to one of the character’s “native” animations, it works and the joint names turn black again.
For the moment, all I’m trying to do is test animation on various characters, so the simplest solution might be best. What does the yellow signify, and what am I missing?
Sorry for that omission. I’m using Legacy, although that brings up another question: Am I able to have extra joints if I’m using Mecanim? Our main character has joints for secondary action on his tunic, plus a weapon-holding joint in one hand. Our programmer is having a difficult time figuring out whether characters can use Mecanim AND have extra joints like that, AND share animation.
I’ll jump in here. @SomeGuy22 can correct any information I provide that isn’t accurate.
I’m not sure Legacy animations are retargetable. The documentation clearly omits this if they are. There may be a code-er-iffic process to retarget Legacy animations, if there is I do not know of it.
Mecanim was created almost exclusively for this purpose, to allow mocap animations to be retargeted onto humanoid rigs.
Both rigs you have needs to be setup as a humanoid rig to allow for retargeting. The animations also have to be humanoid.
The extra bones/animations that are part of the tunic and weapon can not be included in the base humanoid rig/animations, but they can still be used. They can be layer masked in the Animator Controller. I’ve only done this step once and it just worked for me, on a simple character with a tail. Maybe another dev can add additional help to this last part.
The legacy system doesn’t retargeter animation, but the binding between the animation clip’s animation curve and the transform properties is name base. This mean that if all your rig share the same transform hierarchy with the same name you can reuse the same animation clip. But if your rig have different bone proportion the result may not look exactly like the source animation.
On the other hand mecanim humanoid rig is there to allow you to retarget animation from one character to another one. In a humanoid rig you can have extra transform with animation, the only constraint is that extra transform cannot have animation if they have any descendant as a human transform, otherwise they can be animated like any other transform.