Whenever I disable DevMouseLock, if the player is still in shift lock mode, they will stay in shift lock mode and are not able to exit it. Here is my code (server script):
local player
tool.Equipped:Connect(function()
local player1 = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
player = player1
player.DevEnableMouseLock = true
end)
tool.Unequipped:Connect(function()
player.DevEnableMouseLock = false
end)
That’s not my issue, player is defined later in the code when the player equips the tool. I had to use this workaround because LocalPlayer can not be called in a server script.
My issue is that the shiftlock get’s stuck in the locked mode even when it’s set to false.
The code above works as intended, however, my issue is that when I unequip the tool and I have shift lock enabled, shift lock gets stuck when I set it to false. Video example is here: https://gyazo.com/dbf3821ef57c6ca70923e8b2388b06c3
This is not a bug. Unfortunately it is not possible to force a player out of shift lock. DevMouseLock value only dictates if a player can toggle it, however if they are in shift lock when you disable it the camera will not update, it will stay locked to the player. The only way to force a player out of shift lock is to make a custom shift lock which would then allow you to disable it like any other script. However take it from a guy who spent weeks fighting with this. Find another way, don’t bother trying to make a custom shift lock just get around the issue some other way