With a 144 hertz monitor, jumps sometimes occur when moving the mouse.
I copied the project to add the log:
Here’s what it shows when move the mouse:
At 60 hertz this does not happen.
My guess is that this seems to happen when the locked mouse cursor reaches the edge of the screen and the engine flips it to the opposite side of the screen. At this time, the cursor lags at 144 hertz. Perhaps the implementation of this functionality was carried out only at 60 hertz? But did not check for 144 hertz?
Those values come from the browser mouse events so unfortunately, it is browser bug rather than a PlayCanvas one.
Developers normally check if the dx or dy is larger than a certain number, they would ignore it.
I tried to ignore the jumps, the lag is much less, but still noticeable.
The best result was given by using the previous value, but the lag is still present.
Looks like it’s a Chrome related bug: Chromium mouse bug
Yes, I understand that this is a browser problem. But it would be nice to find a solution to this problem.
Best you can do is to send a bug to Monorail - chromium - An open-source project to help move the web forward. - Monorail and wait for them to fix it
As a workaround, you can try capping the max delta or try an average of the last X frames?
My colleagues and I discussed this topic today. Perhaps the best solution so far is when the value of the previous frame is taken.
Yes, I will probably do so in the near future.