bool Pitch { get; set; }

robot_2Generated
code_blocksInput

Description

The Pitch property of the PhysicsLock struct is a boolean value that determines whether the pitch rotation of a physics object is locked. When set to true, the object will not rotate around the pitch axis, effectively preventing any changes in its pitch orientation.

Usage

Use the Pitch property when you need to control the rotational freedom of a physics object in your game. This is particularly useful in scenarios where you want to maintain a specific orientation or prevent unwanted rotations due to physics interactions.

To lock the pitch rotation, set the Pitch property to true. To allow pitch rotation, set it to false.

Example

// Example of using the PhysicsLock struct to lock pitch rotation

// Create a new PhysicsLock instance
PhysicsLock lockSettings = new PhysicsLock();

// Lock the pitch rotation
lockSettings.Pitch = true;

// Apply the lock settings to a physics object
// Assuming 'physicsObject' is an instance of a physics-enabled GameObject
physicsObject.PhysicsLock = lockSettings;

// Now, the physicsObject will not rotate around the pitch axis.