# enterPointerlock() and exitPointerlock() causing bugs on Firefox and Safari

**URL:** <https://forum.babylonjs.com/t/enterpointerlock-and-exitpointerlock-causing-bugs-on-firefox-and-safari/5827>\
**Category:** Questions\
**Created:** [September 23, 2019, 6:38pm UTC](https://forum.babylonjs.com/t/enterpointerlock-and-exitpointerlock-causing-bugs-on-firefox-and-safari/5827 "2019-09-23T18:38:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![i73](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/i73/32/3167_2.png) [@i73](https://forum.babylonjs.com/u/i73)\
**Post date:** [September 23, 2019, 6:38pm UTC](https://forum.babylonjs.com/t/enterpointerlock-and-exitpointerlock-causing-bugs-on-firefox-and-safari/5827/1 "2019-09-23T18:38:05Z")

</div>

I’m getting a bug that when exitPointerlock() the camera will rotate off on it’s own in Firefox, you are able to see here: [Babylon.js Playground](https://playground.babylonjs.com/#MIFCLG)

Before in my code I had:

```auto
            this.scene.onPointerDown = () => {
                this.engine.enterPointerlock();
            };

            this.scene.onPointerUp = () => {
                this.engine.exitPointerlock();
            };

```

But that would lock the cursor and wouldn’t allow me to rotate the controller. Any ideas?

---

<div class="post-metadata">

**Author:** ![aWeirdo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/aweirdo/32/52_2.png) [@aWeirdo](https://forum.babylonjs.com/u/aWeirdo)\
**Post date:** [September 23, 2019, 7:11pm UTC](https://forum.babylonjs.com/t/enterpointerlock-and-exitpointerlock-causing-bugs-on-firefox-and-safari/5827/2 "2019-09-23T19:11:46Z")

</div>

I see no errors… can you copy/paste the console outputs?

---

<div class="post-metadata">

**Author:** ![i73](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/i73/32/3167_2.png) [@i73](https://forum.babylonjs.com/u/i73)\
**Post date:** [September 23, 2019, 7:15pm UTC](https://forum.babylonjs.com/t/enterpointerlock-and-exitpointerlock-causing-bugs-on-firefox-and-safari/5827/3 "2019-09-23T19:15:12Z")

</div>

Sorry Weird, I was in such a rush that I should have been more specific. Added what I needed to the top,

---

<div class="post-metadata">

**Author:** ![Mercurio](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mercurio/32/23383_2.png) [@Mercurio](https://forum.babylonjs.com/u/Mercurio)\
**Post date:** [December 18, 2020, 10:58am UTC](https://forum.babylonjs.com/t/enterpointerlock-and-exitpointerlock-causing-bugs-on-firefox-and-safari/5827/4 "2020-12-18T10:58:58Z")

</div>

I’m facing a similar problem on Chromium: engine.enterPointerlock() seems to have no effect: engine.isPointerLock is always false. The same script works on Chrome.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [December 18, 2020, 12:08pm UTC](https://forum.babylonjs.com/t/enterpointerlock-and-exitpointerlock-causing-bugs-on-firefox-and-safari/5827/5 "2020-12-18T12:08:06Z")

</div>

It is probably a chromium issue then as it now works in the other browsers ??? do you have pointer lock working ok outstide of babylon in Chromium ?

---

<div class="post-metadata">

**Author:** ![Mercurio](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mercurio/32/23383_2.png) [@Mercurio](https://forum.babylonjs.com/u/Mercurio)\
**Post date:** [December 18, 2020, 1:01pm UTC](https://forum.babylonjs.com/t/enterpointerlock-and-exitpointerlock-causing-bugs-on-firefox-and-safari/5827/6 "2020-12-18T13:01:38Z")

</div>

Yes, i’ve just verified that. It’s a Chromium issue.  
I’ll open an issue on their support forum.  
Thanks

---

<div class="post-metadata">

**Author:** ![Mercurio](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mercurio/32/23383_2.png) [@Mercurio](https://forum.babylonjs.com/u/Mercurio)\
**Post date:** [December 18, 2020, 3:06pm UTC](https://forum.babylonjs.com/t/enterpointerlock-and-exitpointerlock-causing-bugs-on-firefox-and-safari/5827/7 "2020-12-18T15:06:50Z")

</div>

To confirm that, here it is their reply: [CEF Forum • pointerLockApi issue](https://www.magpcss.org/ceforum/viewtopic.php?f=6&t=18078)  
Maybe can be useful to other people facing the same issue 😉
