DevEnableMouseLock property not behaving as intended

Hello,its my first time posting in the dev forum so i wasnt really sure where to post this problem:
Basically i wanted to toggle off the shiftlock of the player when they do a certain thing like touching a part or wallrun in my game,so i set the DevEnableMouseLock to false,the shiftlock icon dissapeared but the mouse was stuck in shiftlock mode i assumed that the MouseBehavior was set to Enum.MouseBehavior.LockCenter but apperantly it was always set to Enum.MouseBehavior.Default i tried setting it to Default myself but the mouse was still stuck.

I noticed that this happened only for my game and another place made before almost 3 years and the newly created places didnt had this issue,the problem is i cannot use another place since i started working on my game before nearly 3 years and i cant transfer all of the datastores,reupload the animatins,dev products,gamepasses and everything to a new place.
I tried to modify the PlayerModule modules,use a lot of diffrent custom shift lock systems but all of them acted as a seperate imitation and werent helpfull in my case

Here is a video of how it should behave from a newly created place:
https://gyazo.com/847b8ee698190bad6bc0339c65900751

This is a video of how it behaves in my game and the test place:
https://gyazo.com/a0d9c1fb4dcb9f401fe28b36adfbcb0e

If you want to test it for yourself i will try to upload a copy of the first version of the place with this problem,what you must do to test it is just toggle shift lock,touch the part that ive placed and see that the mouse will be stuck in one place when DevEnableMouseLock is set to false,im not really sure if this is somekind of setting that causes it or its related with the CoreScripts of the place.

Place1 (Version 1).rbxl (49.0 KB)

1 Like

Try Using UserInputService.MouseBehavior

local UserInputService = game:GetService("UserInputService")

-- How to lock the mouse:

UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter 

-- How to unlock the mouse:

UserInputService.MouseBehavior = Enum.MouseBehavior.Default
1 Like

ive tried multiple times,it doesnt respond no matter what i set it to and when i print(UserInputService.MouseBehavio) it always says that its set to Enum.MouseBehavior.Default
also UserInputService.MouseBehavior is a clientsided behavior where the DevEnableMouseLock is set by the server,because thats just how it works,i feel like only a roblox staff could help me,if you want download the test place and test out diffrent stuff

I don’t know how to change shift lock through code other than this

Might have to do something with the Camera