itch.io is community of indie game creators and players

Devlogs

Fixed mouse in browser game

Wildlife Wasteland
A browser game made in HTML5

I fixed the mouse going off of the window for the in-browser game by adding a single line of code:

Cursor.lockState = CursorLockMode.Locked;

You kind of have to click in and click out and click back in the window though...


It was this easy the whole time yet I over complicated it with trying to warp the mouse and stuff 😭💀

Also I allowed users to change mouse sensitivity which is cool :))

Files

  • Wildlife Wasteland.zip 85 MB
    61 days ago
Download Wildlife Wasteland
Leave a comment