게임 엔진/Unity

[Unity] Parent of RectTransform is being set with parent property.

겜도리도리 2022. 8. 13. 01:32
반응형

개요

유니티에서 부모 설정을 하다가 만난 경고

 

Parent of RectTransform is being set with parent property. Consider using the SetParent method instead, with the worldPositionStays argument set to false. This will retain local orientation and scale rather than world orientation and scale, which can prevent common UI scaling issues.

 

해결

위와 같이 부모를 설정해주지 말고

 

이렇게 부모 설정을 해주면 된다.

 

UI 스케일링 등의 이슈 때문에, 직접 parent에 대입하기보다는 SetParent를 쓰는 것을 좋다고 한다.

반응형