Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug WebGL Input System Mouse Stops and Screen Edge

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

  1. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    225
    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,555
  3. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    225
    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:
    225
    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:
    225
    I never did solve it.