Hi! I'm using game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.LockCenter to lock the mouse to the center of the screen. This works perfectly in Play Solo, however when I run it in game, it doesn't work.
COMMUNITY QUESTION
Why does mouse lock not work in game? [UNANSWERED]
2 answers
I believe you need to set the camera property to LockFirstPerson. Unless you're trying to make it so that the player's mouse is locked but the camera is still outside the player?
1 comment
0
I'm also using LockFirstPerson :/
After reading the wiki here, it says the function must be called from a LocalScript. The script probably worked in Solo mode because I'm told that scripts all run locally in Solo mode. Try putting your code in a LocalScript, and if that still doesn't work, I'll look into it further.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Are there any outputs when you test it?
None.