How to force turn off Shift Lock for players who are using it?

Basically, I’m trying to make a cutscene with camera manipulation. However, if shift lock is pressed, it will turn the player in a wrong direction.

I tried altering the DevEnableMouseLock on the Player and StarterPlayer from the Server, but when I do so, it does toggle the option off, but it keeps them in the shiftlock state (and for some reason, the shift lock icon that appears on the screen disappears).

By it disappearing, I’m referring to this (video from the source thread below):
https://gyazo.com/b12b70fb4b653e69ed46e83e14edaf34

I tried various approaches from previous threads and found no success.

The code needs to disable Shift Lock for a single player and also turn it off if they’re using it; not the entire server.

Any help is appreciated!

Code line/sources:

Player.DevEnableMouseLock = false

https://developer.roblox.com/en-us/api-reference/property/Player/DevEnableMouseLock

It says it can be used in a LocalScript, but it is still non-toggleable. Did the exact thing listed in documentation.

Update: Now this pops up:
https://gyazo.com/7105269bc8128b4c58856be9ce3cdd65

Issue is with the line:

player.DevEnableMouseLock = not player.DevEnableMouseLock
local player = game.Players.LocalPlayer

while true do

player.DevEnableMouseLock = not player.DevEnableMouseLock

wait(5)

end

I’ve tried this personally (on the server) and seem to have the same issue as you, I think this is intended behaviour.

In the “StarterPlayer” folder there is an option to toggle, “MouseLock”. Use that, it’s much easier as you don’t even need a script to this.

Tried that as well just now, this now showed up again:

However, I need the actual action to be toggled off, not the ability to toggle it off.

Are you doing that from within a script? Just toggle it in studio, before you play.

Oh, you got the right property, the other user suggested the wrong one.

Tried that as well and it still replicates the same issue. Same error.

1 Like

Are you trying to do that from the command bar or what?

Check your thread regarding tables/arrays by the way, I left a fairly lengthy response.

1 Like

I did try this the moment you sent it . However, it’s just not being turned off at all.

Even with your link, the error is the same:

Also, thanks for the reply on my previous thread! I appreciate it.

I’m completely lost where you are right now, but how are you trying to toggle the value?

Ignore that bit; I read it wrong. It can actually be used.

What we’re trying to say is that you can do this through StarterPlayer
image

1 Like

The game is meant to support Shift Lock in general; I need it force-toggled off at specific times.

1 Like

I see, this seems to be a roblox limitation. I’ve tried it personally (with your example, you can fire a remote event to the server with the player instance and disable the toggle, but I don’t think you can stop the actual ‘shift lock’.)

2 Likes

I’m starting to think the same as well now, but I’m still curious as to how some developers managed to pull it off. I’ve seen some people have public modules open-sourced, but I’m rather trying to make it core-friendly to my system.

Anyway, I’ll keep the thread open incase anyone has any other ideas. Thanks for trying to help out on this tho!

Most likely, the easiest thing to do is just disable Shift Lock. Still have to think it out for a bit.

The best you can really do is make a custom shift lock system due to roblox current limitations.