Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Bug WebGL Input System Mouse Stops and Screen Edge

Discussion in 'WebGL' started by Hotshot10101, Nov 5, 2022.

  1. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    211
    I am using the 1.4.4 Input System package in Unity 2021.3 with the Third Person starter project that you can download into the Unity Hub.

    It works great except for one thing. The camera follows the mouse movement until the mouse hits the edge of the screen. Then you can't turn any further.

    In a previous version (I think it was 1.4.2), the mouse would get captured by the app and you had to hit ESC to get the cursor to show up, but in that version the mouse wouldn't work on any of the UI elements in the game even when the cursor was visible.

    Now the mouse cursor is always visible and works on all UI elements, but has the problem stated above.
     
  2. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,351
  3. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    211
    I just looked at the Starter Assets Input script that comes with this template and it has 2 checkboxes (that are checked):

    Cursor Locked
    Cursor Input For Look

    I would think those should be doing what you are talking about, but they are not working in WebGL apparently.
     
  4. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    211
    Her is a weird thing. It looks like sometimes when I run the app it locks the cursor and the mouse works fine and other times it doesn't. I think it has to do with when I have it set to run in WebGL or not.
     
  5. KIL-CPH

    KIL-CPH

    Joined:
    Oct 21, 2022
    Posts:
    1
    I have the same issue. How did you solve it?
     
  6. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    211
    I never did solve it.