Skip to content

Instantly share code, notes, and snippets.

@bartwttewaall
Created July 22, 2019 08:05
Show Gist options
  • Save bartwttewaall/d13b12cdfebfd698809003ae5e12a3e0 to your computer and use it in GitHub Desktop.
Save bartwttewaall/d13b12cdfebfd698809003ae5e12a3e0 to your computer and use it in GitHub Desktop.
Combining layers to define a cullingmask
LayerMask everything = -1;
void Start () {
LayerMask uiMask = 1 << LayerMask.NameToLayer ("UI");
cam.cullingMask = everything;
cam.cullingMask &= ~uiMask; // exclude UI layer
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment