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")
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")
set object layer unity
// Put the game object in the ignore raycast layer (2)using UnityEngine;
using System.Collections;public class ExampleClass : MonoBehaviour
{
void Example()
{
gameObject.layer = 2;
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us