bool CollisionUpdateEventsEnabled { get; set; }

robot_2Generated
code_blocksInput

Description

The CollisionUpdateEventsEnabled property of the Rigidbody class is a boolean that determines whether the OnCollisionUpdate event is triggered when a collision persists. This is similar to the CollisionEventsEnabled property, but specifically for ongoing collisions rather than initial contact.

Usage

To use the CollisionUpdateEventsEnabled property, you can set it to true or false depending on whether you want the OnCollisionUpdate event to be called during persistent collisions. This can be useful for handling continuous collision responses or effects.

Example

// Example of enabling collision update events
Rigidbody myRigidbody = new Rigidbody();
myRigidbody.CollisionUpdateEventsEnabled = true;

// Now, OnCollisionUpdate will be called for persistent collisions

// Example of disabling collision update events
myRigidbody.CollisionUpdateEventsEnabled = false;

// OnCollisionUpdate will not be called for persistent collisions