Description
The Right
property of the Transform
struct provides the right direction vector of the transform in world space. This vector is derived from the transform's rotation and represents the positive X-axis direction relative to the transform's 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 relative to its current orientation or calculating directional vectors for physics or rendering purposes.
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 = transform.WithPosition(newPosition);