bool Yaw { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

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

Usage

Use the Yaw 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 restrict an object's movement to certain axes, such as keeping a vehicle upright or preventing a character from spinning uncontrollably.

To lock the yaw rotation, set the Yaw property to true. To allow yaw rotation, set it to false.

Example

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

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

// Lock the yaw rotation
lockSettings.Yaw = true;

// Apply the lock settings to a physics object
// Assuming 'physicsObject' is an instance of a class that supports physics locking
physicsObject.SetPhysicsLock(lockSettings);