Description
The EnableTouch
property of the PhysicsShape
class controls whether the shape can trigger touch events for its owning entity. This includes events such as Entity.StartTouch
, Touch
, and EndTouch
. By setting this property, you can enable or disable the ability of the shape to interact with other entities through touch events.
Usage
To use the EnableTouch
property, you can simply get or set its value on an instance of PhysicsShape
. Setting it to true
will allow the shape to fire touch events, while setting it to false
will prevent these events from being triggered.
Example
// Example of enabling touch events for a PhysicsShape
PhysicsShape shape = new PhysicsShape();
shape.EnableTouch = true; // Enable touch events
// Example of disabling touch events for a PhysicsShape
shape.EnableTouch = false; // Disable touch events