bool EnableTouchPersists { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The EnableTouchPersists property of the PhysicsBody class is used to set the EnableTouchPersists property on all shapes associated with this physics body. This property determines whether persistent touch events are enabled for the physics shapes.

When set to true, it indicates that at least one of the physics shapes has persistent touch events enabled. This can be useful for scenarios where continuous interaction with other physics objects is required, such as in cases where an object needs to maintain contact with another object over multiple frames.

Usage

To use the EnableTouchPersists property, simply set it to true or false depending on whether you want to enable or disable persistent touch events for the physics shapes of the body.

Example usage:

PhysicsBody myPhysicsBody = new PhysicsBody();
myPhysicsBody.EnableTouchPersists = true; // Enable persistent touch events

Example

PhysicsBody myPhysicsBody = new PhysicsBody();
myPhysicsBody.EnableTouchPersists = true; // Enable persistent touch events