Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

2019.4 now mouse stuck inside game window, how can I change this?

Discussion in 'Editor & General Support' started by Tomer-Barkan, Jun 9, 2020.

  1. Tomer-Barkan

    Tomer-Barkan

    Joined:
    Jul 31, 2012
    Posts:
    150
    I was using 2019.3 before, and in play-mode the mouse was free to leave the game area and click on play/paude, inspector, etc.

    Now in 2019.4 the mouse is limited within the game window in the editor, and I need to press ESC or something before I can pause the game. This is not very comfortable for me, is there a way to change this?
     
  2. It doesn't do it for me. Are you sure you haven't introduced any scripts which captures the cursor? Some FPS or TPS controller or something?
     
  3. Tomer-Barkan

    Tomer-Barkan

    Joined:
    Jul 31, 2012
    Posts:
    150
    I do set the cursor to Locked state, but I've always done so in the past and it never affected the editor...
     
  4. Then you either saw a bug in Unity or in your application because confining is working in the Editor and the escape key is used to reset the cursor so you can interact with the editor UI.
    https://docs.unity3d.com/ScriptReference/Cursor-lockState.html
     
  5. Tomer-Barkan

    Tomer-Barkan

    Joined:
    Jul 31, 2012
    Posts:
    150
    Sorry, I meant confined, not locked.

    In 2019.3 it did not affect the editor, I can say for sure because I went back to 2019.3 and the mouse is working as I expected again.

    I guess I can always add an #ifdef UNITY_EDITOR to release the mouse.. but weird that behaviour changes like this with no notice.
     
    Lurking-Ninja likes this.
  6. I don't think it was an intentional change.