`enterPointerlock()` and `exitPointerlock()` on pointer down not working for Firefox and Safari

Line 17 to 25: https://www.babylonjs-playground.com/#SRZRWV#10

I know this is an issue with browsers but when you click in the scene it’s supposed to lock the mouse cursor and allow you to move freely, (works in Chrome) but in FireFox and Safari it locks control until you press escape then you can look around, is there a fix?

I don’t think so (not directly)

Is there anything I can do? Or even check to see the browser so I can toggle this functionality?

Maybe we could ask on Firefox bug databse to see if there is a workaround?

I know they do this for security reasons (they don’t want the webpage to control the mouse) so I’ll just disable this for Safari and Firefox, does Babylon support browser checking?

We do not do it but it is easy to test the user agent :wink:

1 Like

I’m using the Unity toolkit, so it’s not as easy.
But thank you!

Pinging @MackeyK24 to see if he can expose the data

Im not quite clear as to what you are trying to do and what the Unity Toolkit is not letting you do.