Layer Masks in Depth

Layers play a central role in Unity. They are used by Cameras in order to only render parts of a scene, and by lights for illuminating specific objects. But here we’ll look at their use in physics, to control what gets hit by raycasts, sphere casts, overlap sphere, linecast and all that jazz. It turns out that using layer masks can increase the performance of these things, especially if your scene contains a lot of colliders.

Read More