Search Unity

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

TextMeshPro Input Field + new Input System + WebGL = no work

Discussion in 'UGUI & TextMesh Pro' started by therobby3, Jul 6, 2020.

  1. therobby3

    therobby3

    Joined:
    Jan 30, 2019
    Posts:
    131
    The TextMeshPro input textfield does not seem to be working in WebGL. I created a bare-bones new project to test as well, and it still doesn't work. All you have to do is create a text mesh pro input field, set your build to use just the "new" input system, and publish for WebGL. The cursor will go into the textfield and display the blinking caret, but when you type it will not display any text. The "onSubmit" seems to still get called when you press enter on the keyboard though, it's just that no text will display in the textfield when you type. Everything works fine in the editor, but not when published to WebGL.

    I am using the latest text mesh pro, "preview 14, 2.1.0" as well as the newest version of the Input System.

    I also made sure that the event system is using the new "Input System UI Input Module (script)".

    Unity version is 2019.4.1f1.
     
    Kearavain likes this.
  2. evilyapok

    evilyapok

    Joined:
    Jun 30, 2020
    Posts:
    1
    I'm having the same issue.. any more information or resolutions on this? I also tried a regular text input (Non-TextMeshPro) and did not get any keyboard input. Again, this is only for WebGL. Everything works fine for PC mode
     
  3. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Please make sure that you submit a bug report so the New Input System team can address this.
     
  4. therobby3

    therobby3

    Joined:
    Jan 30, 2019
    Posts:
    131
    I went ahead and made a bug report. I'll post a link when it's finished going through. I believe also related to this, is the ScrollRect and mouse wheel. Scroll rect's scroll extremely slow in WebGL when using the new input system.
     
  5. therobby3

    therobby3

    Joined:
    Jan 30, 2019
    Posts:
    131
    Aoedipus and jbertra like this.
  6. TaranisElsu

    TaranisElsu

    Joined:
    Mar 3, 2013
    Posts:
    14
    I have the same problem so I added my vote to the issue, along with some comments with what I am seeing. I'll duplicate that info here:

    I am using these versions:
    • Unity 2019.4.6f1
    • "com.unity.textmeshpro": "2.1.1",
    • "com.unity.inputsystem": "1.0.0",
    Nothing that I type shows up in the input field (no letters or numbers even from the numpad), but arrow and home/end keys do move the cursor around so I know the field has focus.

    @robscherer123 mentioned on the issue that they are also having trouble with scrolling being really slow, both the mouse scroll wheel and using ScrollRect's in-game. I have also experienced that issue and worked around it in my camera controller with the following code:
    Code (CSharp):
    1. float zoom = inputActions.Camera.CameraZoom.ReadValue<float>();
    2. #if UNITY_WEBGL && !UNITY_EDITOR
    3. zoom *= 100f;
    4. #endif
     
  7. MathrimC

    MathrimC

    Joined:
    Jun 17, 2020
    Posts:
    1
    I had the same issue, and found out that it is probably due to the input fields still using the old input system. I fixed it by going to Edit -> Project settings -> Player -> WebGL Settings -> Other Setting -> Active Input Handling and setting that option to "Both" instead of "Input System Package (New)"
     
  8. KeyboardKrieger

    KeyboardKrieger

    Joined:
    Jul 22, 2019
    Posts:
    3
    Thanks mate you made my day. Had the same issue and setting to both solved it :)
     
  9. aromana

    aromana

    Joined:
    Nov 11, 2018
    Posts:
    137
    I do not believe this issue is fixed. Setting the input handling to "both" is a workaround, but it shouldn't be needed since the new input system is now considered stable.

    However, TextMeshPro does not work at all via the new Input System when building for WebGL on the latest version of Unity 2020.2.
     
    mimiCryMuffin likes this.
  10. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    What version of the TMP package are you using?
     
  11. aromana

    aromana

    Joined:
    Nov 11, 2018
    Posts:
    137
    TextMeshPro Version 3.0.4 and Unity 2020.2.6f1 (the latest)
     
  12. Bramverhoeven2

    Bramverhoeven2

    Joined:
    Dec 5, 2017
    Posts:
    6
    I still have issues with this in Unity 2020.2.5f1 and 2020.3.3f1. I created a bug report with ID: 1329319_vrhtckbumg8phfu5

    Setting the input handling to "both" does indeed fix it, but I prefer to only use the new system.
     
    bobbaluba likes this.
  13. bobbaluba

    bobbaluba

    Joined:
    Feb 27, 2013
    Posts:
    81
    Same issue on 2020.3.4f1 and input system 1.0.2 tmp 3.0.6

    EDIT: workaround of using "both" worked for me as well.
     
    Last edited: May 14, 2021
  14. ShinyOpal

    ShinyOpal

    Joined:
    Dec 17, 2022
    Posts:
    32
    Had the same issue on 2021.3.18f1 with input system 1.4.4 and tmp 3.0.6 on OSX Ventura 13.0.1

    Workaround did not work for me.

    However I noticed when I created a new scene the EventSystem was missing. Only Main Camera and Directional Light were in the new scene. Copy paste from the previous scene did the trick. Actually it works well with the new input system. No need to have Both enabled.
     
    Last edited: Feb 10, 2023