Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity get layer of gameobject

// This will retrun the layer mask of the specified gameObject
gameObject.layer

// You can as well modify this value through code
gameObject.layer = LayerMask.NameToLayer("SomeOtherLayer")
 
PREVIOUS NEXT
Tagged: #unity #layer #gameobject
ADD COMMENT
Topic
Name
2+6 =