An animated character typically has a number of different movements that are activated in the game in different circumstances, called Animation Clips. For example, we might have separate animation clips for walking, running, jumping, throwing, and dying. Depending on how the artist set up the animation in the 3D modeling application, these separate movements might be imported as distinct animation clips or as one single clip where each movement simply follows on from the previous one. In cases where there is only one long clip, you can extract component animation clips inside Unity, which adds a few extra steps to your workflow.
If your model has multiple animations that you already defined as individual clips, the Animations tab looks like this:
You can preview any of the clips that appear in the list. If you need to, you can edit the time ranges of the clips.
If your model has multiple animations supplied as one continuous take, the Animation tab looks like this:
In this case, you can define the time ranges (frames or seconds) that correspond to each of the separate animation sequences (walking, jumping, running, and idling). You can create a new animation clip by following these steps:
For example, you could define the following:
For further information, see the Animation tab.
Another way to import animations is to follow a naming scheme that Unity allows for the animation files. You can create separate model files and name them with the convention
modelName@animationName.fbx. For example, for a model called
goober, you could import separate idle, walk, jump and walljump animations using files named
email@example.com. When exporting animation like this, it is unnecessary to include the Mesh in these files, but in that case you should enable the Preserve Hierarchy Model import option.
Unity automatically imports all four files and collects all animations to the file without the @ sign in. In the example above, Unity imports the
goober.mb file with references to the
wallJump animations automatically.
For FBX files, you can export the Mesh in a Model file without its animation. Then export the four clips as
goober@_animname_.fbx by exporting the desired keyframes for each (enable animation in the FBX dialog).