Understanding OnTrigger methods in Unity

Let’s talk about OnTrigger methods in Unity! Do you know when they are invoked or for what you can use them? Let’s see in this post! ?

In one of the recent posts, we spoke about OnCollision methods and the fact that Unity has two separate physics engines.

Of course, like with collisions, there are different trigger methods for the 2D and the 3D engines. For 3D there are OnTriggerEnter(), OnTriggerStay() and OnTriggerExit() methods. For 2D there are almost the same OnTriggerEnter2D(), OnTriggerStay2D() and OnTriggerExit2D() methods.

Continue reading “Understanding OnTrigger methods in Unity”