How can I lock the player's camera to make it like the camera-lock-switch camera?

I cannot find out a way to make the player camera lock the mouse while in third person, any help?

local UIS = game:GetService("UserInputService")

UIS.MouseBehavior = Enum.MouseBehavior.LockCenter

Something like this should do the trick. Must be in a localscript for it to work

More information: UserInputService.MouseBehavior

Where exactly should be the localscript? I have placed it in StarterGui and in StarterPlayer, but none did anything

Odd, may try this in StarterGui?


local UIS = game:GetService("UserInputService")

UIS.MouseBehavior = Enum.MouseBehavior.LockCenter

Maybe the game wasn’t fully loaded by the time the script was ran

Well, This is odd.

It is not even sending any errors or anything. Maybe it’s because I disabled LoadCharacterAppearance or because I disabled ShiftLockSwitch

I tried many methods to try and set the camera to lockCenter but none seem to work. What are you trying to do with the camera exactly so I could maybe redirect you to a resource that should help you out

I am trying to make a camera style just like Fortnite for example, where the mouse is locked on the screen, but in third person still.

I believe this resource should be able to help you in your case

It provides what you probably want and has easy customization. It has default keys set to do stuff, but they’re i nthe ModuleScript itself you can easily disable those

1 Like

I will try! I hope I figure it out.

1 Like