Collisions and triggers
To detect physical interactions between game objects, the most common method is to use a collider component—an invisible net that surrounds an object's shape and is in charge of detecting collisions with other objects. The act of detecting and retrieving information from these collisions is known as collision detection.
Not only can we detect when two colliders interact (collision detection), but we can also detect when particular colliders are intersecting (trigger-mode collision detection) and even pre-empt a collision and perform many other useful tasks by utilizing a technique called Ray Casting. Ray casting, in contrast to detecting intersecting 3D shaped colliders, draws a Ray—put simply, an invisible (non-rendered) vector line between two points in 3D space—which can also be used to detect an intersection with a game object's collider.
Ray casting can also be used to retrieve lots of other useful information such as the length of the ray (therefore, distance...