MirkoDev
MirkoDev

Reputation: 11

how can i add ThreeJs PointerLockControl on mobile version

i'm building a ThreeJs school project and i need to add a mobile version of PointerLockControl

i had search "pointerLockControls mobile version" on google but i don't found anything. can you tell me if is possible to add this mobile version to my project?

Upvotes: 1

Views: 63

Answers (1)

Blaze Branham
Blaze Branham

Reputation: 78

You could add an HTML button that fires a function that toggles the pointer lock. When you press the button it will trigger the PointerLockControlls. Sorry if this is not what you were looking for.

const controls = new PointerLockControls(camera, document.body);

funtion lockControls(){
controls.lock();
}
<button onclick"lockControls()">Lock controls</button>

Upvotes: 0

Related Questions