Hello i am in the creation of a game and i had a issue.
(I am gonna use topic creation template to be clear.)
What do you want to achieve? Keep it simple and clear!
I want to be able to enable and disable shiftlock whenever i want, with enable and disable i mean that i can force shiftlock like if someone pressed LeftShift. (not the option to toggle it)
What is the issue? Include screenshots / videos if possible!
I cant find any way to enable it, i tried enabling DevEnableMouseLock but if i disable it and then enable it again the player will not have shiftlock activated, just the option to enable it.
What solutions have you tried so far? Did you look for solutions on the Creator Hub?
DevEnableMouseLock and thats it.
I have modified the PlayerModule’s CameraModule so you can force-toggle the given player’s shiftlock by setting the custom SHIFTLOCK attribute under it, like so:
You must disable the property StarterPlayer.EnableMouseLockOption in the Studio to avoid players from they, by themselves, toggle their shiftlock, and actually forcing the attribute’s settings into, as you intend.
Attached below is the modified PlayerModule. The file is a .rbxm , meaning that you can load it directly into StarterPlayerScripts by right-clicking StarterPlayerScripts → Insert → Import Roblox Model.
You can just use usergamesettings:rotationtype to force enable or disable shift lock their ability to enable or disable it and just do when this key is pressed usergamesetting:rotationtype = enum.rotationtype.camerarelative for shiftlock and userinputservice.mousebehavior = lockcenter
Combine thse 2 for custom shiftlock, its easier than u think
Basically
local ugs = UserSettings().GameSettings
local uis = game.UserInputService
ugs.RotationType = Enum.RotationType.CameraRelative --MovementRelative for back
uis.MouseBehavior = Enum.MouseBehaviour.LockCenter --Default for back
Your method looks fine, however, it doesn’t offset the camera as in the Roblox-provided shiftlock.
Original poster asked to force shiftlock into rather than just a custom one.