- Home /
This question was
closed Oct 14, 2018 at 07:19 AM by
hexagonius for the following reason:
no information on the actual use case given
Question by
UKDv12 · Oct 13, 2018 at 10:33 PM ·
collision detectiontriggers
OnTriggerEnter being called multiple times
I have a an object with a Sphere Collider attached to it with the IsTrigger boolean checked
I have a function that is as follows
private void OnTriggerEnter(Collider other)
{
Debug.Log(other.transform.name);
}
At the beginning, this works normally. When other objects enter the Trigger Collider, the name is output to the console window. However, after a few seconds, it begins repeatedly calling the OnTriggerEnter function. I have tested this again changing the collider to a BoxCollider but it still happens. Why is this happening?
Note: I understand that I could use a sentinel value to solve this, and I plan on implementing that. However, I want to understand why this happens to begin with.
Comment