You can lock the mouse now!

Recently, there have been several topics on locking the mouse, which roblox actually supported already, although hidden in the documentation, PiggyJingles has pointed the feature out to me, and since he’s not RBXDev (yet, I filled out a request to have him entered) , he can’t post this here himself

the link to its sparse documentation is here:

and the feature is a property of UserInputService, called MouseBehavior, and has a few settings via Enum.MouseBehavior, like LockCenter, LockCurrentPosition, and Default

code snippet:
UserInputService.MouseBehavior = Enum.MouseBehavior.LockCurrentPosition

how has no one known?!

I don’t know, but I’m soooo excited! :smiley:

I wouldn’t really call that page ‘sparse documentation’ nor would I call it ‘hidden’. There’s not really much you can say about mouse updates because WYSIWYG, and the only time people really find these features is if they actually go looking for them specifically.

Don’t mean to be nitpicky, but you mean UserInputService

I actually posted this about 2-3 months ago now, it was only available on Gametest at the time.