Search Issue Tracker

Fixed in 2019.2.X

Fixed in 2018.4.X

Votes

4

Found in

5.5.0f3

Issue ID

873218

Regression

No

Xbox One Gamepad triggers are not working in WebGL builds

WebGL

-

To reproduce:
1. Open the attached project
2. Play in editor and notice what controller triggers do
3. Build for WebGL
Result: Xbox One controller triggers do not work

Reproduced on: 5.6.0b7, 5.5.1p3, 2018.2a3

Seems to be only reproducible while using the Xbox One controller

Controllers tested: Shield controller, Xbox One controller
Tested on: Firefox 51.0.1 (32-bit), Chrome 55.0.2883.87 (64-bit)

Comments (4)

  1. tregonzales

    Apr 11, 2018 19:53

    The triggers are actually axes. Left trigger is axis 9 and right trigger axis 10 just like the windows controller mapping here: http://wiki.unity3d.com/index.php?title=Xbox360Controller
    However the buttons are not mapped consistently. From testing i found them to be mapped as such:
    LTweb and RTweb are simply axes i added to my input manager that use the controller's axis 9 and 10.
    switch (button){
    case "RB":
    return Input.GetKey("joystick button 5");

    case "LB":
    return Input.GetKey("joystick button 4");

    case "RT":
    return Input.GetAxis("RTweb") > 0;

    case "LT":
    return Input.GetAxis("LTweb") > 0;

    case "DpadLeft":
    return Input.GetKeyDown("joystick button 14");

    case "DpadTop":
    return Input.GetKeyDown("joystick button 12");

    case "DpadRight":
    return Input.GetKeyDown("joystick button 15");

    case "DpadBottom":
    return Input.GetKeyDown("joystick button 13");

    case "back":
    return Input.GetKeyDown("joystick button 6");

    case "middle":
    return Input.GetKeyDown("joystick button 16");

    case "start":
    return Input.GetKeyDown("joystick button 7");

    case "X":
    return Input.GetKeyDown("joystick button 2");

    case "Y":
    return Input.GetKeyDown("joystick button 3");

    case "A":
    return Input.GetKeyDown("joystick button 0");

    case "B":
    return Input.GetKeyDown("joystick button 1");

    case "LeftStick":
    return Input.GetKeyDown("joystick button 8");

    case "RightStick":
    return Input.GetKeyDown("joystick button 9");

  2. BreynartStudios

    Feb 22, 2018 13:17

    Replicated also with a Xbox 360 controller on both of them: latest version of Google Chrome and Mozilla Firefox. Unity version 2017.3.1f1 (64-bit). Windows 7 x64 OS.

  3. glloq

    Jan 22, 2018 09:19

    Issue still replicated using an XBox 360 controller
    Tested with Firefox 57.0.4 (64-bit) and Unity Version 2017.3.0f3

  4. noahabannister

    Dec 09, 2017 01:24

    Replicated this issue using an Xbox 360 controller.
    Unity Version 2017.2.0f3
    Tested on Firefox 57.0.2 (64-bit)

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.