I have a trigger, and I have flying objects.
Whenever my flying objects enter the trigger, they will stop moving.
Till now everything is working.
when objects are clicked, they are destroyed, I need a LayerMask to ignore the Trigger,
since whenever the objects are inside the sphere they don’t get hit by the ray.
So according to this link I have been achieve this, thanks to alucardj.
But I need to do this with the layer name, since I might have 15-20 layers and don’t want
each time go to tag manager to see the number of the layer.
My 10th layer is named “transparent” and I tried this,
But as InfiniBuzz said, just make your LayerMask variable public, then you have a dropdown in the inspector to select the layers you want. The value property will contain the ready to use layer-mask. Depending on how you want to select them you might still want to invert the value:
public LayerMask ignoreLayers;
//[...]
int mask = ~ ignoreLayers.value;