\Question: Is there a way to activate shift lock in a script?
To disable and re-enable it? Yes if a script then you can script it but I don’t know if it will work
Do you know how to disable and re enable it?
Yes, Go to StarterPlayer and there should be an option called EnableMouseLock.
It does not force it i want it to be forced
Starter player was located on explorer.
The settings is the properties window.
If you din’t see explorer, follow my steps :
-
go to view
-
explorer
-
properties
Make sure the Explorer and Properties are open for starter player
It’s not truly imposible to do that.
Try restarting studio or playtest.
LocalScript within the player:
game:GetService"UserInputService".MouseBehavior = Enum.MouseBehavior.LockCenter
For further reference, check out the UIS docs
Try putting this in workspace : script.
Game : GetService"Starter Player".EnableMouseLockOption = true
Putting in Starter Player uses a Local Script
Do my script works?
Yes, it’s 100% a working script
Wait so it goes in starter player scripts?
Yes. If you want a toggleable system, you can do this
eventHere:Connect(function() --Enable
game:GetService"UserInputService".MouseBehavior = Enum.MouseBehavior.LockCenter
end)
eventHere:Connect(function() --Disable
game:GetService"UserInputService".MouseBehavior = Enum.MouseBehavior.Default
end)
Yes, I know that way of doing RBXConnections is bad
Oh yeah, people uses a computer don’t that except for mobile devices.
it doesn’t do anything, because it is just enabling option for player to shiftlock manualy
No, it will work guys.
This gonna work.
then how the heck people get shift lock forced on tools
tool.Equipped:Connect(function()
game:GetService"UserInputService".MouseBehavior = Enum.MouseBehavior.LockCenter
end)
The heck was enable the EnableMouseLock properties.
This function work for all devices.
i believe using userinputservice does the same result
i can still move the mouse after
Perhaps it would help more if you explained to us why you want shift lock to be forced?