BomberUnits
...a Unity learning project
How to animate

How To animate

An animation is saved as its own file (*.anim), which describes the transition of controlled parameters(e.g. its position) over time. This can be used to modify arbitrary object properties and can thus be used for animation or other purposes.
Most of the time, the actual animation is created together with the Modelling and Rigging in its own tool, like Blender. Each animation of a particular imported model will then be imported as well as .anim file.

Each animation can be viewed as a state an object is in with transitions between different animations. These transitions can be done abruptly or smoothly, blending into each other.

Each animated object thus has its own animation state machine it runs through. The Animation Controller asset defines how the different animations aka states transition (blend over) into each other. This asset is supported graphically by Unity, which is super cool to reuse to create State Machines in general visually and not only for animation!

The Animator component is added to an object that shall be animated. It gets assigned the created Animation Controller to organize when which series of animations is applied to an object in a state-machine-like fashion.

Thoughts on networking

You need to decide whether your animations need to be synchronized over the network.

  • Does the animation give important gameplay info or cues which everybody needs?
    Example: A charged, red glowing bomb is more dangerous than a normal one -> sync
  • Doe the animation trigger any events that need to be synchronized?
    It is possible to call functions during animations. If their effects need to be synced then of course those functions need sync themselves or the animation needs to be synced itself.

For syncing animations, triggered transitions need to be synced.

Further reading: