this.app.mouse.enablePointerLock(); stopped working

Hello.

I’ve been developing a game for a while, one of my scripts locks the pointer when the user clicks by using “this.app.mouse.enablePointerLock”, I have checked that the code is able to call that line of code, and it does, but out of nowhere it stopped working.

I have added console.logs before and after that line, and they print as expected. Version of the engine is 2.7.4

Not sure if there has been an update and something got messed up as I haven’t changed that script.

Is there another way that I can use?

My piece of code that out of nowhere started to not working… I have checked that the code goes inside the if statement.

Player.prototype.onMouseDown = function (e) {

    if (
        !GameManager.getInstance().getUiState() &&
        !pc.Mouse.isPointerLocked()
    ) {
        this.app.mouse.enablePointerLock();
        return;
    }
}

It could be only in the launcher, multiple people reported that. Try published build. Also, copy & paste the link from launcher, and load it from a new tab you create.

Hi, did you manage to solve the problem?