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
- Crash on when D3D12RenderPass::SetupDeviceResources when opening FBX animation preview
- Serialization errors are thrown when "com.unity.render-pipelines.core" is added as a custom package and Graphics window is opened
- Character Joints unexpectedly rotate when a ragdoll is created using the Ragdoll Wizard
- Crash on GfxDeviceD3D11Base::DrawBuffersBatchMode when rendering the Scene view
- The shared EditorBuildSettings.asset file of symlinked projects is not updated when changing the order of the Scenes in Build Settings in one of the projects
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.