The Align To Gravity Zone ability will orient the character to the direction of the gravity zones. Gravity Zones are triggers which influence the gravity direction of the character. The demo scene uses a Gravity Zone on each exterior planet:

When the ability is active and the character is within a Gravity Zone the character will reorient according to the Gravity Zone’s influence. The character can be within multiple Gravity Zones and the character will be oriented towards the average of all of the Gravity Zone. Each Gravity Zone can have its own influence multiplier which in the image above it allows the larger planet to influence the character more than the smaller planet.

The Gravity Zone is and abstract class that can be inherited to return a custom gravity direction. The demo planets use a spherical Gravity Zone whose gravity direction is determined by the pivot position of the object.

Setup

  1. Select the + button in the ability list under the “Abilities” foldout of the Ultimate Character Locomotion component.
  2. Add the Align To Gravity Zone ability. The ability is concurrent so the ability can be positioned anywhere within the ability list.
  3. Add a Gravity Zone to the object that should influence the character’s gravity. The ability will automatically start when the character is within a Gravity Zone.

Inspected Fields

Rotation Speed

Specifies the speed that the character can rotate to align to the ground.

Stop Gravity Direction

The direction of gravit that should be set when the ability stops. Set to Vector3.zero to disable.