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.
  2. Dismiss Notice

TextMesh Pro ForceMeshUpdate not working.

Discussion in 'UGUI & TextMesh Pro' started by MAWMatt, Apr 18, 2023.

  1. MAWMatt


    Nov 10, 2016
    I folks, so I've used ForceMeshUpdate before with great success. Suddenly it's not working, and I don't know why.

    Code (CSharp):
    1. m_Message.text = "Some message to actual test had 3 lines of text";
    2. m_Message.ForceMeshUpdate( true, true );
    3. if( m_Message.textInfo.lineCount > 0 )
    4. {
    5.     // do some positional work
    6. }
    The lineCount is always 0. When I inspect the textInfo, it's not populated at all. I made sure to pass true for both arguments.

    I don't recall changing any of the code between now and when it last worked. Any ideas?!

    Thanks for the help!