float z { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The z property represents the Z component of a Vector3 structure. It is a floating-point value that specifies the position along the Z-axis in a 3D space.

Usage

Use the z property to get or set the Z coordinate of a Vector3 instance. This property is useful when you need to manipulate or retrieve the Z-axis value of a vector in 3D space.

Example

// Example of using the z property
Vector3 position = new Vector3(1.0f, 2.0f, 3.0f);

// Accessing the z component
float zValue = position.z;

// Modifying the z component
position.z = 5.0f;

// Output the modified vector
Vector3 modifiedPosition = position; // Now (1.0f, 2.0f, 5.0f)