Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Add a layer to a layerMask

Add a new layer to a layerMask via script.
Read time 1 minuteLast updated 24 days ago

To add a layer to a layermask, use the logical OR operator on the original layermask and the layer to add.
originalLayerMask |= (1 << layerToAdd);

Additional resources