03 Simulation Root

This sample demonstrates how you can use a SimulationRootModifier to simulate in an object's local-space instead of the default world-space.

It uses several animations to move the characters in various ways:

  • Left: gradually turns.
  • Middle: teleports the rotation.
  • Right: teleports the position.

The top row shows the default behaviour, which is to simulate in world-space. This means all movements affect the simulated motion, so the left character's hair sways as they turn and the teleportation of the other two is treated as very fast movement which causes the hair to jump violently.

The bottom row shows the effects of a SimulationRootModifier on each character with the Simulation Root set to the character's root object to have the simulation run relative to that object:

Having a root means that movement of the root or its parents won't affect the simulation so the hair still moves as a result of the animation moving the head but it isn't affected by turning or teleporting the whole character.

The Simulation Root can be enabled and disabled or changed at runtime, so you could have it normally simulate in world-space but teleport without affecting the simulation by enabling the modifier, doing the teleport, then immediately disabling the modifier again.