Creature Control for Unity v0.1
Loading...
Searching...
No Matches
Animating Creatures

The Insect component has a built-in walking animation mechanism. This can be used by assigning the InsectAnimator found in Runtime/Animation/InsectAnimator.controller to the Animator Controller field of the Insect component.

Note
Although it is technically possible to assign a generic animation controller here, it will in general not lead to good looking animations. The InsectAnimator is setup specifically for this purpose.

Additionally, you may want to tune the Step Size parameter to make the step length of the creature you are working with. A 10mm ant will take much smaller steps than a 30cm walking stick bug.

With this set up, the animation is controlled automatically by moving the Rigidbody or Transform around in the scene.

Note
If you drag the Transform manually with you mouse in the scene during runtime, it will most likely not result in smooth movements as the velocity of the Transform is not smooth.

Animation and Posing

The animations are relative to the pose of the creature in the Editor. So if you pose the feet far apart, the creature will walk with a wide pose, while it walks with a narrow pose when they are posed close to each other.

More information is found in the Posing documentaion.

Creature Controllers

The various creature controllers (for instance, the Insect Controller) use Unity's Input Actions to control the creature moving around and can be used as a starting point for more complex interaction controls

Rigidbody and Transform

The animation work without a Rigidbody or with a kinematic or dynamic Rigidbodies. For the latter two options, you may want to attach a body collider to the creature. An easy way to do this is to use the Add Body Collider button in the Inspector of the Insect script.

Note
A warning will appear when a Rigidbody component is present with Interpolate set to None as this will lead to non-smooth animations. Set it to either Interpolate or Extrapolate. Generally, the Interpolate leads to smoother results but introduces a bit of latency.
  • Without Rigidbody: the creature will not collide with any object in the scene.
  • Kinematic Rigidbody: the creature will push away other non-kinematic Rigidbodies, but its movements are not affected by them or static colliders.
  • Dynamic or non-kinematic Rigidbody: full collision and gravity support are present and the creature will not be able to walk into other objects.