- Home /
The question is answered, right answer was accepted
OnTriggerEnter not working, OnTriggerExit is
Hi all,
So I have one sphere in my game, and one sprite. Both have rigidbodies, and both have colliders with their triggers ticked.
For some reason, only OnTriggerExit works. I've been using this simple code to test it:
void OnTiggerEnter(){
Debug.Log("in");
}
void OnTriggerExit(){
Debug.Log("out");
}
Out will display when I move the sprite outside of the sphere (the player is the sprite, the sphere is stationary), but the "in" message never triggers. Anyone know why?
Always watch your spellings. They are one tough error to find since people don't try to spot them and take for granted. ;-)
Answer by bakkoto · Jul 08, 2014 at 07:52 AM
Hi, you have to change void OnTiggerEnter() to void OnT*r*iggerEnter().
As detail-oriented as I may be, this is the same reason my own script wasn't working. Thank you so much!