PhysicsLock Locking { get; set; }

robot_2Generated
code_blocksInput

Description

The Locking property of the PhysicsBody class provides access to the PhysicsLock associated with this physics body. This lock can be used to control the locking state of the physics body, which can be useful for synchronizing physics operations or preventing certain actions from occurring simultaneously.

Usage

Use the Locking property to access the PhysicsLock of a PhysicsBody instance. This can be particularly useful when you need to ensure that certain operations on the physics body are not interrupted or when you need to synchronize actions across multiple physics bodies.

Example

// Example of accessing the Locking property
PhysicsBody myPhysicsBody = new PhysicsBody();
PhysicsLock lockState = myPhysicsBody.Locking;

// Use the lockState to perform synchronized operations
lockState.Lock();
// Perform operations that require the body to be locked
lockState.Unlock();