The z
property represents the Z component of a Vector4
structure. It is a single-precision floating-point value that can be accessed and modified to represent the third dimension in a 4D vector.
The z
property represents the Z component of a Vector4
structure. It is a single-precision floating-point value that can be accessed and modified to represent the third dimension in a 4D vector.
To access or modify the z
component of a Vector4
instance, use the following syntax:
Vector4 vector = new Vector4();
float zValue = vector.z; // Access the Z component
vector.z = 5.0f; // Modify the Z component
Vector4 vector = new Vector4(1.0f, 2.0f, 3.0f, 4.0f); float zComponent = vector.z; // zComponent is 3.0f vector.z = 10.0f; // Now the z component of vector is 10.0f