System.Action<Collider> OnTriggerExit { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The OnTriggerExit property is an event handler that is invoked when another collider exits the trigger area of this collider. This property is of type System.Action<Collider>, meaning it takes a single parameter of type Collider, which represents the collider that exited the trigger.

Usage

To use the OnTriggerExit property, assign a method that matches the Action<Collider> delegate signature. This method will be called whenever a collider exits the trigger area of this collider. Ensure that the IsTrigger property of the collider is set to true for the trigger events to be fired.

Example

// Example of using OnTriggerExit
Collider myCollider = new Collider();
myCollider.IsTrigger = true;

myCollider.OnTriggerExit = (exitingCollider) =>
{
    // Handle the collider exit event
    Log.Info($"Collider {exitingCollider} has exited the trigger area.");
};