털털한 개발자, 긔저기의 개발공간

몇몇 안드로이드 기기에서 TextMeshPro의 텍스트가 제대로 출력되지 않는 경우가 발생한다.

 

처음에 메모리 문제인줄 알고 약간의 최적화까지 해봤지만 역시나 같은 반응

 

문제는 TextMeshProUGUI와 TextMeshPro에 Material을 혼합하여 사용하기 때문에 발생하는 것이였다.

 

<Material Preset>

 

이게 오류가 뜨거나 로그를 찍어봐도 포지션, 컬러 등등 잘 나오기 때문에 정말 찾기 힘든 버그였다..

 

해결법은 UGUI용 Material과 일반 MeshRenderer용 Material를 따로 구분해주면 된다.

 

 

TMP 오브젝트의 Inspector 밑의 Material 부분에 왼쪽 클릭

 

 

요렇게 하나 더 만들어주자

 

 

 

 

https://forum.unity.com/threads/null-reference-exception-with-empty-string.522184/

 

TextMesh Pro - Null Reference Exception with Empty String

TextMesh Pro returns a null reference exception error if I try to reference text that's empty. I get the error even if I try to get the text.length....

forum.unity.com