Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Question Unwanted dollar sign appearing in TMP_text text

Discussion in 'UGUI & TextMesh Pro' started by unity_9Iw1hIqfScfnbw, May 12, 2021.

  1. unity_9Iw1hIqfScfnbw

    unity_9Iw1hIqfScfnbw

    Joined:
    Oct 1, 2018
    Posts:
    3
    A dollar sign is finding its way into the TextMeshPro Text (UI) component in our Unity Project. When I stopped assigning the dollar sign in code, the first time in game the string is set properly. Then second and subsequent times, there is a $ put before it.

    I have tried using SetText() and field.text =

    When debugging, the string being assigned to the TMP_Text does not have the $, but one ends up being in the text of the TMP_Text. Is this a setting in the editor that I'm missing? Other text fields are displaying properly, and I don't see any differences in the Inspector.

    If I *do* assign a $ in the string, it doesn't get a second one. So something is going on.

    Thanks in advance for any help on this. Google failed me.
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Are you able to reliably reproduce this? If so, can you export a simple scene with script that would enable me to look at it?

    This could be related to how you set the text. See if using the .text property makes any difference. See if using a different font asset makes any difference.
     
  3. unity_9Iw1hIqfScfnbw

    unity_9Iw1hIqfScfnbw

    Joined:
    Oct 1, 2018
    Posts:
    3
    Yes, it is 100% reproduceable

    It happened using .text and SetText()

    I will see about putting together a small scene to share. Thank you :)
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    If you can provide the project here or submit a bug report with that project that would be great.