Reputation: 11
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
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