Description
The Right
property of the Transform
struct provides the right direction vector of the transform in world space. This vector is perpendicular to both the Up
and Forward
vectors, forming a right-handed coordinate system. It is useful for determining the rightward direction relative to the transform's current orientation.
Usage
Use the Right
property to obtain the right direction vector of a transform. This can be useful for operations such as moving an object to the right or aligning another object relative to this transform's right direction.
Example
// Example of using the Right property
Transform transform = new Transform();
Vector3 rightDirection = transform.Right;
// Move an object to the right by 5 units
Vector3 newPosition = transform.Position + rightDirection * 5;
transform.Position = newPosition;