Description
The Vector3Int.OneZ
field is a static member of the Vector3Int
struct. It represents an integer vector where the Z component is set to 1, and the X and Y components are set to 0. This field is useful for operations that require a unit vector along the Z-axis.
Usage
You can use Vector3Int.OneZ
whenever you need a vector that points in the positive Z direction with a magnitude of 1. This is particularly useful in 3D grid-based systems or when performing operations that require a directional vector along the Z-axis.
Example
// Example usage of Vector3Int.OneZ
Vector3Int direction = Vector3Int.OneZ;
// This can be used to move an object along the Z-axis
GameObject myObject = new GameObject();
myObject.Position += direction;