What do Layers affect? More than cameras and lights?

I have been learning more about layers. And from what I have read so far I can use layers to set up relationships between lights, cameras and other objects.

So for example I could have light 1 shine only on box 1 and 2, but not box 3
And the same goes for cameras. I could have a camera see only box 1 and 2 but not box 3 using layers.

My question is this, can you do more than connecting lights and cameras to objects with layers? Could you use layers to set up other types of relationship like which object can collide with another object?

Wait, Layers cannot be used for selective lighting. You can use layers to define an object-camera relationship. Meaning only objects in compatible layers are visible for the respective camera and thus rendered.

Besides, layers can be used in context of raycasting. By configuring Raycaster.layers, you can ensure that only certain objects will be part of the ray/intersection test.

1 Like

@makman About layers and lights: Layers and lights