Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

TextMesh Pro ForceMeshUpdate(true) not working when object inactive

Discussion in 'Unity UI & TextMesh Pro' started by DED-Games, Apr 1, 2018.

  1. DED-Games

    DED-Games

    Joined:
    Nov 1, 2010
    Posts:
    98
    I'm trying to assign a text to an inactive TextMesh Pro text object, and then get the text info with
    textInfo
    . Before accessing
    textInfo
    , I call
    ForceMeshUpdate(true)
    to update the object; I would expect setting the parameter
    ignoreActiveState
    to
    true
    would update the object even if it's inactive, but it doesn't. Am I misinterpreting the parameter, or is it a bug?:

    Code (CSharp):
    1. textComponent.text = text;
    2. textComponent.ForceMeshUpdate(true);
    3. numCharsFromTextInfo = textComponent.textInfo.characterCount; // Returns incorrect data
    For now it seems activating the object just before updating and deactivating it afterward works, but it's not very nice, and doesn't work if one of the parent objects is inactive.
     
    Last edited: Apr 1, 2018
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    1,991
    Thank you for taking the time to provide feedback.

    I'll take a look and make the necessary changes if required.
     
  3. DED-Games

    DED-Games

    Joined:
    Nov 1, 2010
    Posts:
    98
    Thanks. By the way, I may have found a pair of other things that look like bugs, should I report them from Unity's bug report tool?
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    1,991
    It is up to you.

    If these are trivial and easily reproducible, you can report them here. If they are more challenging to reproduce, then submitting a bug report with Repro case is always best as I can focus on a solution as opposed to trying to reproduce something.
     
  5. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    1,991
    I have addressed the incorrect behavior of the ForceMeshUpdate(bool ignoreActiveState). This change will be included in the next release of TMP.
     
  6. shell123

    shell123

    Joined:
    May 26, 2016
    Posts:
    4
    Was this fixed? I am still running into it. When the gameobject is inactive at the time of a ForceMeshUpdate(true) call the bounds are not updated. When the gameobject is active at the time of a ForceMeshUpdate(true) call the bounds are updated correctly.
     
  7. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    1,991
    What version of TMP are you using?

    This should be working but once you let me know what version you are using, I can double check on my end.
     
  8. shell123

    shell123

    Joined:
    May 26, 2016
    Posts:
    4
    I am using 1.3.0.