히가츠류의 보금자리

[Unity] Tag와 Layer 설정 본문

Programming/UnityGame_etc

[Unity] Tag와 Layer 설정

HiGaTsu Ryu 2022. 7. 19. 17:45

맨날 까먹어서 메모용

 

 gameObject.tag = "Player";
int LayerIgnoreRaycast = LayerMask.NameToLayer("Ignore Raycast");
        gameObject.layer = LayerIgnoreRaycast;

 

[참고 Unity Documentation]

- GameObject.tag : https://docs.unity3d.com/ScriptReference/GameObject-tag.html

- GameObject.layer : https://docs.unity3d.com/ScriptReference/GameObject-layer.html

 

Comments