- Home /
Question by
armoredpokey · Dec 23, 2012 at 04:18 PM ·
layerslayermask
Method Not Found -- LayerMask.NameToIndex
The documentation tells me I can call LayerMask.NameToIndex('my layer name') to get back an integer (or really LayerMask, I guess). However, when I try to do this, I get the following error:
MissingMethodException: Method not found: 'UnityEngine.LayerMask.NameToIndex'.
What could be the problem? I'm running version 3.5.6f4 but even the local docs say I should be able to do this.
Comment
Best Answer
Answer by MarkFinn · Dec 23, 2012 at 04:34 PM
It seems it's actually
LayerMask.NameToLayer("TransparentFX")
rather than
LayerMask.NameToIndex("TransparentFX")
Your answer
Follow this Question
Related Questions
How to achieve this basic physics effect? Detect when to change layers 2 Answers
Setting Layer Weights properly 0 Answers
is it possible to copy a mecanim layer? 2 Answers
A game object can only be in one layer. The layer needs to be in the range [0...31] 6 Answers
Physics2D.CircleCast produces no result whenever a layer mask is specified 1 Answer