Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to force player into Mouse Lock?

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?

1 comment

0

You should be aware of what property you are editing

1 answer

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.