PhysicsLock Locking { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Locking property of the PhysicsBody class represents the locking state of the physics body. It is of type PhysicsLock, which is used to control the locking behavior of the physics body in the simulation. This property allows you to specify how the physics body should be locked, such as locking its position, rotation, or both, to prevent it from moving or rotating in the simulation.

Usage

To use the Locking property, you can get or set its value to control the locking behavior of a PhysicsBody instance. This is useful when you want to restrict the movement or rotation of a physics body in the simulation.

Example usage:

PhysicsBody body = new PhysicsBody();
body.Locking = PhysicsLock.Position; // Locks the position of the body

Example

PhysicsBody body = new PhysicsBody();
body.Locking = PhysicsLock.Position; // Locks the position of the body