Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question TextMeshPro text not updating after text is changed.

Discussion in 'Localization Tools' started by louxuanchen, Nov 21, 2023.

  1. louxuanchen

    louxuanchen

    Joined:
    Mar 5, 2021
    Posts:
    1
    I have a textmeshpro setup to show the current wave
    upload_2023-11-21_22-44-2.png
    but the text is not updating after wave number change, it stuck at "Wave 0", but if I change the language back and forth using the editor ui, it update the text for once the freeze.
     
    Last edited: Nov 21, 2023
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,146
    The auto-update only works when using a variable that supports IVariableValueChanged.
    You are using an Object Reference variable, so if the object reference is changed the update will be triggered however it is unable to know if anything inside that reference has changed. So you will need to trigger the update by calling RefreshString on the LocalizedString or by using a variable that supports change events.