Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

New Input System not working on WebGL

Discussion in 'WebGL' started by jtiret, Jun 2, 2021.

  1. jtiret

    jtiret

    Joined:
    Nov 11, 2020
    Posts:
    63
    Hello there,

    I am using the Input System (the new one, not the "old" "Input Manager") to handle inputs in my game.

    I am using it both for the UI (essentially UI Toolkit and a little bit of Unity UI) as well as in game to control the character. To handle in-game inputs (controlling the character), I have created an Input Actions file, which is then referenced by the Player Input component on my character's GameObject:

    Screenshot 2021-06-02 at 12.19.24.png

    Everything is working well on all platforms, including Editor, Standalone (Mac) and Standalone (Windows).

    However, on WebGL, only the UI inputs work. I can click on buttons in the UI (both UI Toolkit and Unity UI), the "hover" effect (when I move my cursor over buttons) is properly detected, etc.

    However, controlling the character doesn't work at all (using keys on my keyboard has no effect), although it works perfectly on Standalone builds.

    Do you have any idea why this doesn't work on WebGL? Is there anything specific that has to be done on this platform to make it work?

    Thanks in advance!
     
    GhoulishGames likes this.
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,002
  3. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    944
    Definitely if you have a behavior that works in editor and native but not in WebGL, go ahead and report that as a bug. That would be something that we should either document as differing behavior by design, or outright fix it up if there is a bug. Looking at the bug backlog, there are currently no active tracked WebGL + New Input System bugs on our radar. :(
     
    De-Panther likes this.
  4. Marks4

    Marks4

    Joined:
    Feb 25, 2018
    Posts:
    491
    @jtiret create a bug report, otherwise it won't be fixed...
     
  5. jtiret

    jtiret

    Joined:
    Nov 11, 2020
    Posts:
    63
    Thanks for your insights, I will create a test project reproducing the issue and will submit a bug report. Will let you know how it goes.
     
  6. SonnyCS13

    SonnyCS13

    Joined:
    Dec 17, 2022
    Posts:
    1
    i have the same problem, pretty sure switching back somehow to the old input system fixes it. not sure how easy that is tho :/
     
  7. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    754
    My new input works with webgl, do you have say anything other than mouse and keyboard?
     
  8. thesolodev

    thesolodev

    Joined:
    May 20, 2017
    Posts:
    1
    In my case, I discovered that setting the Stripping Level in the Player > Other Settings to High or Medium disabled the operation of the keyboard in WebGL. When you set the Stripping Level to Low, the keyboard respond to movement.