Search Unity

CursorLockMode.Locked breaks FreeLookCamera in new input system

Discussion in 'Cinemachine' started by charlesaverill20, Apr 18, 2021.

  1. charlesaverill20

    charlesaverill20

    Joined:
    Jan 24, 2019
    Posts:
    14
    I'm having some issues with locking the cursor and using the FreeLookCamera in conjunction with the new input system. Ideally, I'd want the cursor locked at the center of the screen with `CursorLockMode.Locked`, and the delta from the mouse movements is what rotates the camera.

    This was functioning properly before I implemented the new input system. Now that I have implemented it, whenever I lock the cursor in this way, I can't rotate the camera at all. If I use Confined or don't lock the mouse at all, I'll be able to rotate the camera, but only until the mouse hits the edge of the screen, so a full 360' rotation around the player character is not possible.

    My "Look" axis in the new input system uses `Delta [Pointer]`, but I've tried `Delta [Mouse]` as well, same outcome. I'm using the Cinemachine Input Provider script with my Look axis placed in the `XY Axis` field.

    Am I doing something clearly wrong here? I feel like I've done everything I can to make the camera function like it did before. Is there something I'm missing?

    Edit: Tested my build and this issue does not occur on Mac. I've been testing and developing on the Linux editor, so it's probably an issue there.
     
    Last edited: Apr 18, 2021
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730