Description
The Collisions
property of the PhysicsJoint
class is used to enable or disable collisions between the two physics bodies that are constrained by the joint. This property is a boolean value, where true
allows collisions and false
prevents them.
Usage
To use the Collisions
property, you can simply get or set its value on an instance of a PhysicsJoint
. Setting this property to true
will enable collisions between the two bodies, while setting it to false
will disable them.
Example
// Example of using the Collisions property
PhysicsJoint joint = new PhysicsJoint();
// Enable collisions between the constrained bodies
joint.Collisions = true;
// Check if collisions are enabled
bool areCollisionsEnabled = joint.Collisions;
// Disable collisions between the constrained bodies
joint.Collisions = false;