bool CollisionUpdateEventsEnabled { get; set; }

book_4_sparkGenerated
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 for a Rigidbody
Rigidbody myRigidbody = new Rigidbody();
myRigidbody.CollisionUpdateEventsEnabled = true;

// Now, OnCollisionUpdate will be called for persistent collisions.