Search Unity

WarpCursorPosition is locking the cursor for a split of a second

Discussion in 'Input System' started by Jerga, May 14, 2022.

  1. Jerga

    Jerga

    Joined:
    Nov 12, 2020
    Posts:
    1
    Hi folks,

    I am working on the following functionality.

    I set the cursor visibility to false while holding the right or left mouse key and store the last position where the cursor was visible.

    On the release of the left/right key, I move the cursor to the last visible position and set visibility back to true, with

    Mouse.current.WarpCursorPosition(lastCursorPosition);
    Cursor.visible = true;

    This works great, but the cursor freezes for a few milliseconds while I am moving the mouse. The movement is not as fluid as you would expect.

    Please see the attached video and notice that when the cursor re-appears, it takes a little time until it catches up and continues in the movement even though I am constantly moving the mouse.



    I really appreciate any help you can provide.

    Cheers.