Description
The Backward
property of the Rotation
struct provides the backwards direction vector of the current rotation. This vector is the opposite of the forward direction and is useful for determining the direction opposite to where the rotation is facing.
Usage
To access the backwards direction of a Rotation
instance, use the Backward
property. This property returns a Vector3
representing the backwards direction.
Example
// Example of using the Backward property
Rotation rotation = Rotation.FromAxis(Vector3.Up, 90);
Vector3 backwardDirection = rotation.Backward;
// Use backwardDirection for calculations or transformations
// For example, moving an object backwards
GameObject myObject = new GameObject();
myObject.Position -= backwardDirection * speed * Time.Delta;