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

How to force player into Mouse Lock?

Asked by 6 years ago

I'm aware of

game.StarterPlayer.EnableMouseLockOption = false

which allows me to force a player out of mouse lock or enable them to shift-click it. However, I'm trying to force the player into mouse lock mode any suggestions?

0
You should be aware of what property you are editing Griffi0n 315 — 6y

1 answer

Log in to vote
0
Answered by
RubenKan 3615 Moderation Voter Administrator Community Moderator
6 years ago

Using a localscript and UserInputService, you can lock the mouse in the center as so:

game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.LockCenter

More info can be found here

Ad

Answer this question