Shift Lock Always On

Hello fellow developers!
I am wondering is it posible to make a “Shift Only Script”? because I am making a game with a friend, and we need a script where you can’t turn shift lock off. So is it posible to make a script that makes shift lock always on? If it is please help us/me. :slight_smile:

1 Like

You can set Player.DevEnableMouseLock to false. (oh wait, this actually doesn’t enable mouselock)

Not sure if this is possible.

Instead, you could turn shiftlock off entirely and implement a ‘third person camera’ script. A really helpful article is the following: Customizing the Camera | Documentation - Roblox Creator Hub

This would not work as the player can simply disable it right afterwards.
This property is not used for toggling the state, it toggles the ability of the player to switch it on and off independently.

That’s misunderstanding the context @LukaDev_0. He’s asking for shift-lock to be FORCED on.

To do third person locks, you have to use a script; Roblox has no built-in third person locks that the developer can impose onto players.

One way is modifying the base camera script for ShiftLockEnabled to always be set to true, although Xbox and Mobile players will have some trouble.

Hope I helped :slight_smile:

Setting it to false makes it so that the option is set the Set by Developer (i also misunderstood. and the OP wants it to be forced on)

You would need to make the mouse stay in the middle of the screen. Which is impossible

No. UserInputService does this with one line of code.

Wait? really. How would u do that?

You have to have a custom camera script. You can’t force shift-lock without doing so.

There is already another DevForum post about this. Please check the marked solution.

Another tip: take a quick look around the forums before making a new topic. I found this post in under 20 seconds, so why spend 5 minutes waiting for a feesible reply?

3 Likes

Do a simple google search before asking the DevForum.
UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter

2 Likes

I just found out when u Said that :stuck_out_tongue:

You can set UserInputService.MouseBehaviour to Enum.MouseBehaviour.LockCenter as @iGottic said. Then u can use UserInputService:GetMouseDelta() to get the direction and then u can change the camera

1 Like

Please mark @iy_uhn’s reply as a solution.

In addition, please do a simple google or devforum search before asking everybody, because it does end up wasting your time that could have been used more productively.

Thanks :slight_smile:

2 Likes