Pointer Lock Controls – #6 by stickandrope – Cocos Creator


I got the solution by editing @muxiandong example like this:
FirstPersonCamera.ts.zip (1.7 KB)

This is how the demo looks:

On the click on screen, we get pointerlock, with esc be unlock the pointerlock. There is problem if try to lock the pointer right after we unlocked it we get: The user has exited the lock before this request was completed. As I understood we get this error as of security reasons, so the app could’t freeze the user with constantly locking him. This could be avoided with better UX. Hope this would be helpful, and if someone have suggestions on how could I do it better I would really like to improve my skills :slight_smile:

Source link

More To Explore

Share on facebook
Share on twitter
Share on linkedin
Share on email