[Unity/TIL] - 4주차 Unity입문 트러블슈팅
1. MainCamera 배경색이 화면을 덮음.
- target을 따라다니는 카메라를 만들었는데
- 플레이해보면 MainCamera에 지정된 Color가 화면을 덮음
=>
z 포지션이 타겟과 동일해져서 그렇다.
MainCamaera의 z 포지션 -10을 유지시켜준다.
target의 x,y 포지션만 동일하게 만든다.
2. 씬을 불러오지 못하는 문제
❗Scene 'MiniGameScene' couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.
라는 오류가 뜨며 씬을 불러오지 못했다.
=>
File - Build Settings에 들어가서 씬을 추가해주니 해결되었다.
3. 스프라이트 오류
❗UnassignedReferenceException: The variable characterRanderer of MiniGamePlayer has not been assigned.
You probably need to assign the characterRanderer variable of the MiniGamePlayer script in the inspector.
MiniGamePlayer 스크립트에서 characterRanderer라는 변수에 SpriteRenderer 컴포넌트가 할당되지 않아서 런타임에서 문제가 발생했다는 뜻.
=>
Character Randerer에 SpriteRenderer을 할당해주니 해결되었다.