As many others I have problems wrapping my head around culling masks… ![]()
So I want to know if layer x is is set in a lights cullingMask. How to do it? I have searched, but couldn’t find stuff beynd hiow to change the culling mask to include (or exclude) x. But to check if x is present… :shock:
I need something like
If (x is present/set in cullingMask)…
SOLVED:
//To check if a given layer is set in the culling mask
int layerToTestIfSet = 10;
if ((thisLight.cullingMask (1 << layerToTestIfSet )) != 0) {
DoWhatever();
}