ScriptReference/LayerMask.NameToLayer #743
Replies: 1 comment
-
This gives you the INDEX of the mask and you still need to left shift it (or just use void example()
{
int mask_index = LayerMask.NameToLayer("UI");
LayerMask mask = 1 << mask_index;
} void example2()
{
LayerMask mask = 1 << LayerMask.NameToLayer("UI");
} void example3()
{
LayerMask combined_mask = (1 << LayerMask.NameToLayer("UI") ) | (1 << LayerMask.NameToLayer("Water") );
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
ScriptReference/LayerMask.NameToLayer
https://docs.unity3d.com/ScriptReference/LayerMask.NameToLayer.html
Beta Was this translation helpful? Give feedback.
All reactions