Search Issue Tracker
By Design
Votes
0
Found in
2018.3.6f1
Issue ID
1132058
Regression
No
[WebGL] Mouse Input.GetAxis is not detected in WebGL until Controller is connected
How to reproduce:
1. Open attached Unity project
2. Build and Run on WebGL
3. Press "Space" until MainGame scene is loaded
4. Move mouse side to side
Expected result: View is controlled by the mouse movement.
Actual result: Mouse movement doesn't control view.
Reproduced with:2019.2.0a7, 2019.1.0b6, 2018.3.7f1.
Notes:
After connecting the controller mouse movement starts to control the view. Disconnecting controller leads to not detecting mouse movements again.
In Standalone build mouse movements are not detected at first, but issue fixes after connecting controller and does not appear again after disconnecting it.
Can't test on 2017.4 because of errors.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
Resolution Note (2019.2.X):
It is not a bug, please see the code. In case of WebGL use development build - it will show that there was an exception in GetJoystick function.
If you try to write
```
try
{
Vector2 leftJoystick =
PlayerInputManager.Instance.GetLeftJoystick(PlayerInputManager.ControllerInput.Controller1);
m_CharacterController.Move(transform.forward * leftJoystick.y * VELOCITY * Time.deltaTime);
m_CharacterController.Move(transform.right * leftJoystick.x * VELOCITY * Time.deltaTime);
Vector2 rightJoystick =
PlayerInputManager.Instance.GetRightJoystick(PlayerInputManager.ControllerInput.Controller1);
AddYaw(rightJoystick.x);
AddPitch(-rightJoystick.y);
}
catch
{
}
AddYaw(Input.GetAxis("Mouse X") * MOUSE_SENSITIVITY);
AddPitch(-Input.GetAxis("Mouse Y") * MOUSE_SENSITIVITY);
```
instead - you will see that it works. Mouse wasn't working because C# exception was raised just before mouse code, so it never gets called.