Unable to use Pointer Lock API

code is at https://github.com/rgdrake/mmorpg/blob/51ac0e33ff506025d5a0e391366e225017151e9a/src/main.js I keep getting THREE.PointerLockControls Unable to use Pointer Lock API and I’ve tried every pointer setting in Firefox’s about:config, still no luck. Please, any help would be appreciated.

1 Like

This line of code does probably not what you expect:

this.controls.lock();

Unfortunately, you can’t just lock the mouse pointer from code. Instead, a user interaction is required. Hence, you have to wrap the method call into an event listener similar to the official example. The relevant code from the demo looks like so:

instructions.addEventListener( 'click', function () {

    controls.lock();

, false );
3 Likes

Thank You!

1 Like

Just an update: Found this tutorial which still works wonderfully: http://graemefulton.com/writings/post/first-person-navigation-with-threejs