Description
The EnableTouchPersists
property of the PhysicsShape
class controls whether the shape can continuously fire touch events for its owning entity. When set to true
, the entity's Touch
method will be called every frame, allowing for continuous interaction detection.
Usage
To use the EnableTouchPersists
property, you can set it to true
or false
depending on whether you want the shape to continuously trigger touch events. This is useful for scenarios where you need to track ongoing contact with the shape, such as when an object is sliding or rolling over it.
Example
// Example of enabling continuous touch events for a PhysicsShape
PhysicsShape shape = new PhysicsShape();
shape.EnableTouchPersists = true;
// Now, the owning entity will receive continuous touch events
// as long as the shape is in contact with another object.