Description
The Vector3.Left
field is a static, public field of type Vector3
. It represents a vector pointing in the left-hand direction in a 3D space. This is achieved by setting the Y component of the vector to 1, while the X and Z components are set to 0. This field is useful for operations that require a consistent leftward direction, such as aligning objects or calculating directional movement.
Usage
Use Vector3.Left
when you need a predefined vector that points to the left in a 3D coordinate system. This can be particularly useful in scenarios involving directional calculations, such as moving an object to the left or determining the leftward direction relative to a given orientation.
Example
// Example of using Vector3.Left
// Move an object to the left by 5 units
Vector3 position = new Vector3(10, 10, 10);
Vector3 newPosition = position + Vector3.Left * 5;
// Output the new position
// Expected output: (10, 15, 10)
Debug.Log(newPosition);