Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Locking mouse into the center of the screen?

Asked by 9 years ago

How can i make the mouse pointer stay locked at the center of the screen, like the shift lock mechanic. I tried looking at the script for it but i don't see how it works

1 answer

Log in to vote
3
Answered by
DevSean 270 Moderation Voter
9 years ago
1-- Lock the mouse in the center of the screen
2game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.LockCenter
3-- Or you can lock the mouse where it is
4game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.LockCurrentPosition
5-- Reset the mouse back to it's normal state
6game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.Default
0
Dude thank you! But where did you get this information?? I tried looking for this everywhere in the wiki! GeezuzFusion 200 — 9y
0
I found it on the wiki under UserInputService http://wiki.roblox.com/index.php?title=API:Class/UserInputService/MouseBehavior DevSean 270 — 9y
Ad

Answer this question