enablePointerLock not working [SOLVED]

Hi everyone,

new user of PlayCanvas, and I try to set Pointer lock on the mouse with enablePointerLock(), but it is simply not working in chrome, or any other navigator when it should.

The weirdest thing was that it was all fine this morning, but suddenly, I am having an issue with it.


this.app.mouse.disableContextMenu();
this.app.mouse.enablePointerLock();
,

using the same class, with disableContextMenu is working, but enablePointerLock, simply does not work.
I activated all the required flags in chrome settings, to make sure it was disabled by the navigator, no results. I deleted all references to this.app.mouse beforehand to make sure it was not due to a misplaced disablePointerLock() call.

Thank you for your help,
Tristan.

Can you share a project that showcases this issue please?

The issue has been fixed, my bad, forgot that it had to be within a Mouse Event , like mentionned in the Documentation API.

1 Like