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, effectively pointing in the reverse direction of the rotation's forward vector.
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, effectively pointing in the reverse direction of the rotation's forward vector.
Use the Backward
property when you need to determine the direction opposite to the forward direction of a rotation. This can be useful in scenarios such as determining the direction to move an object away from a target or calculating the opposite facing direction in a 3D space.
// Example of using the Backward property Rotation rotation = Rotation.FromAxis(Vector3.Up, 90); Vector3 backwardDirection = rotation.Backward; // Use backwardDirection for calculations or transformations // For instance, moving an object in the backward direction GameObject myObject = new GameObject(); myObject.Position += backwardDirection * speed * Time.Delta;