GUI Position Update Delay

We are currently working on moving all our GUI elements away from the legacy GUI and we just finished replacing our in-game cursor image with a canvas.

There appears to be a fairly large delay on the visual position of the cursor compared to the actual input position of the mouse.

Every frame, I’m simply setting the RectTransform position of the cursor to the position of the mouse, but even if the game dips slightly under 60fps, the delay becomes very noticeable compared to where the windows mouse cursor is being displayed.

I’ve tried my position update code in the following places: Update(), FixedUpdate(), and OnGUI(). However, the delayed result is the same every time.

Even though we will hide the actual mouse in game, We still feel as though the delay seems unreasonable.

Is there something about the GUI backend that causes it to only update under certain conditions? Or, has anyone else come across this yet?

Any help would be greatly appreciated. Thanks!

Wouldn’t it be better to use the hardware cursor functionality instead of a canvas sprite? Unless something changed in Unity 5, there’s an API for setting the hardware cursor which will have no lag at all.

Using a sprite will always feel laggy, that’s been my experience anyway with older versions of Unity.

Thanks! We were hoping to avoid hardware cursors due to the scale limitations, but it looks like we’ll probably just bite the bullet and make it work.