I am trying to find a way to call OnTriggerStay to represent leaving a Trigger Collider, which has been destroyed. An OnTriggerExit is not going to help me, as the collider has been destroyed and is never exited properly.
According to the API for OnTriggerStay, “This message is sent to the trigger and the collider that touches the trigger”. I guess this means that I cannot call an opposite of stay within OnTriggerStay, as there is no collider touching a trigger.
At first I thought that the following may have worked:
void OnTriggerStay (Collider other)
{
if (!other is BoxCollider)
{
print("Not in the Trigger Collider");
}
}
I was thinking that looking for !other is BoxCollider within Update could be a way to constantly look for this collider. I do think however, that it would be inefficient and bad practice.
Could anyone please advise on how I could go about looking for a collider of a different object, that no longer exists (that has not been exited) in order to call a function?
Thank you.