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 8 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
8 years ago
-- Lock the mouse in the center of the screen
game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.LockCenter
-- Or you can lock the mouse where it is
game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.LockCurrentPosition
-- Reset the mouse back to it's normal state
game: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 — 8y
0
I found it on the wiki under UserInputService http://wiki.roblox.com/index.php?title=API:Class/UserInputService/MouseBehavior DevSean 270 — 8y
Ad

Answer this question