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 vector that points upwards, such as when applying forces, setting directions, or defining orientations in 3D space.
Example
// Example of using Vector3.Up
Vector3 position = new Vector3(0, 0, 0);
Vector3 upwardDirection = Vector3.Up;
// Move the position upwards by 5 units
position += upwardDirection * 5;