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

Is there a way to force the MouseLock option onto a player?

I want to make a 3rd-person game of sorts and I want the player to behave exactly as if they have the Mouse Lock option selected. Is there a way to make this automatically happen without having the player manually go into their setting and turn it on?

2 comments

0

I forgot where it was located, but every time the user enables and disables shift lock a remoteevent is fired. Find that remoteevent and ou can toggle shift lock.

0

You could set the player's CameraMode to 'LockFirstPerson,' as that'll *force first person & the player's mouse will stay in the center of the screen. :) However, this property is w/in the player's properties, and if you use FE, I'm not sure how that'll turn out. o-o

1 answer

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

Make sure this is set from a LocalScript

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