Confused about the animations

In the project, we simply just drag the player’s character into the animation window and it plays the animation using that character. Or, we could choose to use the Unity default model instead and it works the exact same.

My Question: How does this work where we can apply the exact same animation to different characters? Wouldn’t we need to have unique animations for each character?

I am not sure which project you mean, since I haven’t gotten to the animation part of my current course, and you may not be taking the same class anyway.

That being said, if two characters were rigged with similar enough skeletons, they can share any animations that are compatible with both skeletons. You can assign particular animations to one or more characters in several different ways in Unity, but mostly they start by using an Animator component attached to the character’s gameObject.

One way to control which animation gets played when is to create an Animator Controller, and assign it to Animator. An Animator Controller is a type of State Machine that lets you set up interactive conditions that trigger different animation clips, or sequences of animation clips.

Another way is to connect the Animator to the animation channel of a Timeline, at which point you can cause the character to perform long, relatively linear sequences of animations. These are all a bit complicated to explain in a short forum message but there are lots of tutorials about how to use Animator Controllers. Timelines are newer and a bit less well documented, but they are actually simpler (for this purpose at least) and there is info about how to use them as well.

1 Like

To clarify this a bit… In the old system (legacy or generic), you had to have the EXACT same skeleton to share animations. With the current mecanim system, if you import the characters as Humanoid, (and make sure the animator is set with the avatar from that import), then you can use any animations for humanoid characters.
image
This is the secret sauce between sharing animations.
Note that sometimes even with humanoid imports, the way the character is mapped to its bones may prevent another humanoid animation from looking perfectly right. Generally, though, you’re fine to share animations with other humanoid characters.

2 Likes