Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Bug TMP SubMeshUI fails to render when created in edit mode

Discussion in 'UGUI & TextMesh Pro' started by tomkail_betterup, Jan 24, 2023.

  1. tomkail_betterup

    tomkail_betterup

    Joined:
    Nov 17, 2021
    Posts:
    103
    Not quite sure what the cause of this is, but we've noticed occurrences of invisible text in cases where TMPSubMesh is used. In our case, that's because we're using Text Styles that require a different font. Deleting the submesh (which causes it to be immediately recreated) solves the issue temporarily - but it tends to occur again.

    We've noticed that in the debug inspector, the Sub Text Objects array has lots of null objects.

    Not sure what the exact cause is, but we've managed to make it occur consistently by having a prefab which contains a TMP UI object, opening the prefab, and then forcing the that text to refresh in edit mode.

    Refreshing in edit mode Update using [ExecuteAlways] is a common cause too - especially when you enter and exit prefab mode or play mode.
    I thought that SubMeshes were supposed to not be saved?
     
    Last edited: Jan 24, 2023
  2. tomkail_betterup

    tomkail_betterup

    Joined:
    Nov 17, 2021
    Posts:
    103
    Bump this! Can anyone from Unity comment? It's easy to replicate when using Text Styles that require different fonts, and when using [ExecuteAlways] on prefabs.