Unity tiene un sistema de animación excelente y sofisticado llamado Mecanim. Mecanim proporciona:
Unity’s animation system is based on the concept of Animation Clips, which contain information about how certain objects should change their position, rotation, or other properties over time. Each clip can be thought of as a single linear recording. Animation clips from external sources are created by artists or animators with 3rd party tools such as Max or Maya, or come from motion capture studios or other sources.
Animation Clips are then organised into a structured flowchart-like system called an Animator Controller. The Animator Controller acts as a “State Machine” which keeps track of which clip should currently be playing, and when the animations should change or blend together.
Un simple Animator Controller podría solamente contener uno o dos clips, por ejemplo para controlar un powerup de girar y rebotar, o para animar una puerta que se abre y se cierra en el tiempo correcto. Un más avanzado Animator Controller puede contener docenas de animaciones humanoides para todas las acciones de los personajes principales, y pueden mezclarse entre múltiples clips al mismo tiempo para proporcionar un movimiento fluido a medida que el jugador se mueve alrededor de la escena.
Unity’s Animation system also has numerous special features for handling humanoid characters which give you the ability to retarget humanoid animation from any source (for example: motion capture; the Asset Store; or some other third-party animation library) to your own character model, as well as adjusting muscle definitions. These special features are enabled by Unity’s Avatar system, where humanoid characters are mapped to a common internal format.
Each of these pieces - the Animation Clips, the Animator Controller, and the Avatar, are brought together on a GameObject via the Animator Component. This component has a reference to an Animator Controller, and (if required) the Avatar for this model. The Animator Controller, in turn, contains the references to the Animation Clips it uses.
El diagrama de arriba muestra lo siguiente:
Unity’s animation system comes with a lot of concepts and terminology. If at any point, you need to find out what something means, go to our Animation Glossary.
Mientras Mecanim es recomendado para uso en la mayoría de situaciones, Unity ha mantenido su sistema de animación anterior que existía antes de Unity 4. Usted pueda necesitarlo cuando trabaje con contenido viejo creado antes de Unity 4. Para información acerca del sistema de animación anterior, ver esta sección