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

Mouse lock failure WebGL build on itch.io

Discussion in 'Web' started by Jkau2, Mar 13, 2018.

  1. Jkau2

    Jkau2

    Joined:
    Jan 26, 2017
    Posts:
    3
    I'm having a strange issue where my cursor will not lock in the itch.io game window. I've tried just about every combination of "Embed Options" possible, but with no success. I've seen a few old posts with similar issues to this, but they have no resolution other than a browser issue. I think something different is going on in my case as I am able to achieve correct mouse lock in older games that I have created using similar builds, but in my most recent games with the same browser am unable to lock cursor. Here are two examples.

    https://justinkau.itch.io/kesey-square-2 - This is a game I just uploaded a few days ago and I cannot achieve mouse lock in the game window.

    https://justinkau.itch.io/strawberry-plaza - Whereas this is a game that I uploaded about a year ago and it locks the mouse just fine (both run on my Windows 10 machine in Chrome).

    Both of these games have the standard Unity First-Person controller and I have not modified the scripts for either except with global variables in the inspector panel. I mean to imply by this that I haven't tinkered with anything in the scripting in a way that it might alter the final conditions of the WebGL build state.

    I have four versions of this "Kesey square" game and they are all functioning the same way with an inability to achieve mouse lock in itch.io window.

    Any help would be greatly appreciated!
     
  2. Jkau2

    Jkau2

    Joined:
    Jan 26, 2017
    Posts:
    3
    So, I'm not sure where the issue was occuring, but removing my PlayMakerGUI from the scene solved the issue.

    This must've just been a random bug - because it only occurred in one of four (mostly) identical scene builds. All the scenes had the PlayMakerGUI (iterated down from a parent generation), but on a hunch after digging through lots of forum issues with Cursor.lockState I tried removing it from the one problem scene and voila...

    I sincerely hope this helps if anyone is having similar issues. I spent many frustrating hours on this one.