🔗Aligner
1.4.9
Overview
Align the position and rotation of a Target Object to a gameObject with this component. Usually, this component is used by the Zones to align the Animal that uses it.

Limitations
This only works when the animal is grounded.
How to use it
Let's take the Chest Sample on the Demo scene: 1 - PlayGround Human (1 - Holsters) as an example. In this scene, when you approach the central chest, Steve will be aligned (Re-position and oriented_ so it plays the animation in the right direction/position:

To use it, you need to call the function: Aligner.Align(Transform TargetToAlign).
In the chest example. Whenever an Animal enters the Zone, it will tell the aligner to align the entering character to the correct position.

Parameters
Position
Align the Target to the Position of the Main Point.

If the Second Point is set, then it will align the Target to the closest point on the line made from both points.


Rotation
Orient the target to the rotation of the Main Point.

Look At
Orient the Target to look at the Main Point Position.

Radius (Look At)
If the Radius is greater than zero, then the Target will be positioned also to the closest position on the radius created from the look-at.

Double Sided (Position - Rotation)
Allows the Target to align correctly to a Double Side Position and rotate correctly to the rotation of the aligner. This is useful when you want 2 different positions and rotations, when facing an aligner in a 180 direction.

Main Point
Main Transform to use as Position, Rotation and Look At values to make the Aligment
Second Point
Extra Transform to use as Position, Rotation.
Align Time
The time needed to make the alignment
Align Curve
Interpolation to make the alignment.
Angle Offset (Rotation - LookAt)
Adds a Rotation offset to the Rotation or Look At alignment.
Last updated
Was this helpful?