FindWithTag()

FindWithTag는 앞에 GameObject가 붙는데 Tag가 GameObject로부터 접근할 수 있으므로 GameObject가 붙는다.

FindWithTag()

그리고 이전의 코드에서 parent는 transform 타입이므로 이 게임 오브젝트 타입인 parentGameObject도 trasform에 접근해야한다.

trasform

이렇게 하면 FIndWithTag로 찾아도 잘 담기는 걸 확인할 수 있다.

FindWithTag 참조

+ Recent posts