Description
The Vector3.Up
field is a static, public field of type Vector3
. It represents a vector pointing in the upwards direction in 3D space, with the Z component set to 1 and the X and Y components set to 0. This is commonly used to denote the upward direction in a 3D coordinate system.
Usage
You can use Vector3.Up
whenever you need a reference to the upward direction in 3D space. This is particularly useful in scenarios involving physics calculations, camera orientation, or any situation where a consistent upward direction is required.
Example
// Example of using Vector3.Up
Vector3 position = new Vector3(0, 0, 0);
Vector3 upwardPosition = position + Vector3.Up * 10;
// This will move the position 10 units upwards in the Z direction.