Search Unity

Bug TMP_InputField Caret World Space UI Bug

Discussion in 'UGUI & TextMesh Pro' started by Somiaz, Feb 20, 2024.

  1. Somiaz


    Apr 1, 2019
    Title pretty much explains it, here's how to recreate this bug:
    • Create a World Space Canvas and adjust to typical player size (1 x 1 will do).
    • Create a TMP_InputField in that canvas and adjust to fit inside the canvas.
    • Create a script that allows you to interact with the Input Field as a World Space Canvas object.
      • Using inputField.Select(); in Update will suffice.
    • Type text in play mode.
    • Watch the inputted text go left, off the canvas.
    The caret becomes extremely stretched and changes the position of the input text. I found that deleting the caret after it is created fixes the issue temporarily (till the caret is created again when the game starts).

    So I figured that including an option to disable the caret from being created would be the best temporary fix while the original bug gets resolved.