Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity GamePad For WebGL

Discussion in 'Web' started by mgw2021, Dec 21, 2021.

  1. mgw2021

    mgw2021

    Joined:
    May 22, 2021
    Posts:
    4
    I do have following warning on browser. How can i disable the GamePad when exported to WebGL as my game do not really need the GamePad.

    getGamepad will now require Secure Context. Please update your application accordingly.
     
    ppirner likes this.
  2. huulong

    huulong

    Joined:
    Jul 1, 2013
    Posts:
    224
    So, somebody answered on the old thread in General Discussion (https://forum.unity.com/threads/unity-gamepad-for-webgl.1214562/, read but don't post there) before we moved the discussion here, so I'll sum up what has been said and add some info:

    1. On Chrome, when running a game using gamepad with the new Input System, and testing with a local server, I get the following error:

    2. Unity dev suggested to check https://docs.unity3d.com/Manual/PlatformDependentCompilation.html and exclude gamepad support

    3. Both OP and I don't see much besides the built-in packages. But personally I need that Input System package for keyboard/mouse (and gamepad support on PC) anyway, so I can't just drop it. Searching "gamepad" on the page gives nothing.

    So, how do we actually exclude gamepad support, and besides, how do we do this for WebGL build only?