Monthly Archives: December 2017

Collision Detection in Unity Explained (i.e., Colliders, Triggers and Ray-casting)

In your games, you will often need to detect collisions between objects. This can be related to NPCs or objects that you will collect or interact with. For this purpose, you can use (and monitor) colliders. However, the way you manage collisions, and the methods to be called in this case, will highly depend on the type of colliders used (for example, colliders or triggers) as well as the object from which you want to detect the collision (for example, simple objects or character controllers).

This being said, you may want to be able to detect the presence of objects located far away from the player or the NPC. In this particular case, ray-casting may make more sense than collision or trigger detection.

So this tutorial will explain in great details how you can detect objects using a wide range of techniques such as colliders, triggers and ray-casting.

  Continue reading