I encountered this problem when making an FPV project, and I find this even in the official tutorial project, which is, if you move your mouse quickly, the camera would jitters as if it was canceling your mouse movement.
Since this problem exhibits in the official projects, I don’t even konw if this is only my problem or a generic one? How do I solve this?
I wonder if it has anything to do with Windows display scaling? I’ve had odd behaviour with Chrome generally and display scaling before when used multiple displays.
Interesting, I’ve had similar issues on both of my computers before as well, even in demos such as After the Flood. Once I had that issue in a project, and I decided to do some debugging. It turns out that the mouse move event was sometimes generating large values in the wrong direction at random intervals if the mouse was locked to the screen.
Here’s an example of the error. The screen is showing x and y coordinates from mouse move events with the cursor locked, after moving the mouse slowly up and left for a while.
this.app.mouse.enablePointerLock();
After moving the mouse consistently up and left for a while, I suddenly got a mouse event going down and right by a lot. This has happened on multiple computers. The simple demo I made can be found here.
@will@dave Any idea what could be causing this? I’ve so far seen this error on multiple devices.
I find that this problem doesn’t show on my Win10 latop using Chrome Stable (Version 63.0.3239.132). I’m wondering - can you see whether this problem also occurs in Chrome Canary? If not, it’s a bug Google has already fixed. I’m very confident this is a browser issue and almost certain this isn’t anything to do with PlayCanvas itself.
A way to confirm this is to write a super-simple vanilla (non-PlayCanvas) HTML page that uses the mouse lock API and then reads the mouse. If you can repro this in an isolated, simple page, and Google haven’t fixed this already in Canary, you should let them know about it: