Search Unity

TextMesh Pro TMPro: Caret randomly disappearing (always shows in editor; not game)

Discussion in 'UGUI & TextMesh Pro' started by MrLucid72, Feb 25, 2020.

  1. MrLucid72

    MrLucid72

    Joined:
    Jan 12, 2016
    Posts:
    996
    If I have a TMP_Input, sometimes it will show the caret and sometimes it will not. Within the editor, it always shows it. While playing, each new character MAY "reset" the caret to show, but not always. See below for missing caret in player, but not editor:

    upload_2020-2-25_12-22-20.png

    This is easier seen as a GIF. Note the inconsistency: Even repeating "t" will sometimes show caret, and sometimes hide. This confuses end-users, as it looks like they accidentally unfocused the input:



    # Settings



     

    Attached Files:

  2. Antistone

    Antistone

    Joined:
    Feb 22, 2014
    Posts:
    2,836
    Hypothesis: the caret is less than 1 pixel wide, and the width gets "rounded" differently depending on where "within" the pixel the caret happens to fall. (Another poster on this forum recently had this problem with strikethrough.)

    On the input field settings, try increasing the caret width and see if that affects the behavior.
     
    dqdandan and MaxPfeil like this.
  3. psuarez98

    psuarez98

    Joined:
    Jun 5, 2018
    Posts:
    2
    Were you able to solve this? I have the exact same problem and changing the Caret width didn't solve it :(
     
  4. psuarez98

    psuarez98

    Joined:
    Jun 5, 2018
    Posts:
    2
    Nevermind. Changing the Caret width to an even bigger value (say 4 or 5) solved it!