Weird mouse input behaviour in samples (Browser<->Editor)

Hi,

the Mouse.Delta values read from the new input system do not work as expected and behave very strange. I could not found any other issues like that, so I hope it is just a different setting on my side (although I’m still using the default samples).

My setup:

  • Unity 2021.2.7f1 (win11)
  • GPU: RTX 3080
  • Render Streaming 3.1.0-exp2
  • Samples (URP scene + webserver.exe)
  • Testing on local network (ethernet)

With the inspector set to debug mode I observe the “input look” variable of the script SimpleCameraControllerV2, which is the Vector2 readvalue from the delta+button action. When clicking and moving the mouse on a separate notebook, the values do not reset properly when not moving anymore. You have to release the mouse button. When stopping the mouse, you still rotate the camera. The values when not moving anymore vary between 1 and something crazy like 15 or above (and its negative counterparts). When you try to bring both values, x and y, to zero, one of them always jumps back to something like 1 or 3 or so…

It gets even worse: If the game view in the editor does not have focus (for example I click somewhere in the hierarcy), the input look values are suddenly the absolute mouse position with zero in center of the game screen. As soon as the game view in the editor gets its focus back, the values behave like above. Because of that it’s not possible to test on the same machine (editor + browser). Of course, using a separate notebook is a workaround, but the above issue still exists.

Hopefully some of you have an idea. I’m surprised that nobody seems to have this issue.

Edit:
Just tested on another PC (GTX 1070) with Unity 2020.3.18. Everything works fine. None of the above issues exist (except that I get no video when using hardware encoder support). Will do some more tests whether its caused by the pc, the unity version or my specific unity install.

Edit2:
Did some more tests:
2020.3.18 & 2020.3.27 - working
2021.2.7 & 2021.2.10 - not working

The input debugger shows the correct delta values. It seems that setting the Update Mode of the input system package to fixed update, sometimes the correct 0,0 values are received. The input system itself seems to be working fine in 2021.2.

Thanks for sharing the issue.

After downgrading a project from 2021.2 to 2020.3 I got the same problems. After a bit of testing I found out, that this problem occurs if you have any Input System later than 1.0.2 installed, independent of the unity version, although the docs say you need v1.1.1. for 2021.2.

I tested this with input sytem 1.1.1, 1.2.0 and 1.3.0, but only 1.0.2 is working for both unity 2020.3 and 2021.2.

Just to give another opinion: the new package workflow in 2021 is horrible. The Unity Render Streaming package even has a dependency for the input system 1.0.2, but you cannot easily change it from the default installed 1.2 - at least not in 2021.2.7.

I understood.
I will check the latest version of the Input System.

Have you checked this document?
https://docs.unity3d.com/Packages/com.unity.renderstreaming@3.1/manual/use-inputsystem.html

Yes, to that document I referred above when I said “the docs say”. All the settings are correctly set. I tried the other settings too, but then no input at all was received.

Edit:
Had another project in 2021.2.7 with the new UI Toolkit and with the input system 1.0.2 I could not receive UI clicks. So I tested the 1.1.1 again and…suddenly its working, kind of.

1.1.1 and 1.2.0 are working if the receiver and the editor are not on the same machine and the game view in the editor has focus. The settings “background behavior” and “play mode input behavior” of the input system package do only change the behavior if the game view is out of focus: with the settings written in the docs the mouse delta has suddenly absolute values, with default settings no more input is received (!only when game view is out of focus).

With 1.0.2 the focus thing is not an issue, so that testing on the same machine works (but UI Toolkit does not).

Edit2:
Ok, now it’s again not working in the sample scene after a git checkout. Deleted the library, but this did not help.
My scene: working.
Sample scene in the same project: not working…

Fixed weird mouse behavior in this pull request.