-
[유니티] 플레이_오브젝트 레이어 설정게임 개발 2020. 1. 16. 00:19
행성을 만들기 위해 gravityArea, planet, coin/meteor을 만들던 중 레이어가 생각과 다르게 나와
행성이 gravityArea 밑에 깔리는 경우가 발생하였다.
이를 방지하기 위해 오브젝트의 레이어를 설정해주었다.
위의 화면을 보면 각각 sprite 설정창에서 Sorting Layer, Order in Layer을 찾아볼 수 있다.
Sorting Layer는 사용자가 설정한 단어로 레이어를 구분할 수 있고
Order in Layer는 숫자로 레이어를 구분할 수 있다.
숫자로 레이어를 구분했다간.. 엄청 헷갈릴 일이 생길 것 같아
나는 Sorting Layer로 레이어를 구분해 주었다.
이렇게 창을 열어 Layer 이름을 설정해 줄 수 있다.
편리한 점은 Layer를 드래그하여 순서를 변경할 수 있다는 점이다.
이렇게 레이어를 만들고
각각의 오브젝트에 알맞은 레이어를 부여하니
전과 같이 행성이 gravityArea에 깔리는 현상은 없어졌다.
'게임 개발' 카테고리의 다른 글
[GitHub] merge시 충돌 코드 처리하기 (0) 2020.09.03 [유니티] 중심 회전하다 클릭하면 직진하기 (0) 2020.01.28 [유니티] 플레이_조건 맞는 행성 만들기 (0) 2020.01.15 [유니티] 플레이_오브젝트 위치구하기 (0) 2020.01.15 [유니티] 플레이_타겟 위치로 카메라 이동 (0) 2020.01.12