saile515
(saile515)
December 25, 2019, 9:01pm
#1
I want to be able to force shift lock but be able to disable it. I have seen topics about this but they are either outdated or i can’t figure it out. I want it to lock it when you are in game but be disabled when you are in the lobby like Rumble Quest. A step by step guide or something simular would be really
appreciated. Thanks in advance!
5 Likes
ZexityBlox
(ZexityBlox)
December 25, 2019, 9:04pm
#2
Toggle StarterPlayer.EnableMouseLockOption
saile515
(saile515)
December 25, 2019, 9:06pm
#3
That just does so you can have shift lock, i want the character to be automaticly put in to shift lock.
ZexityBlox
(ZexityBlox)
December 25, 2019, 9:09pm
#4
game.StarterPlayer.EnableMouseLockOption = true
1 Like
saile515
(saile515)
December 25, 2019, 9:14pm
#5
As i said, that is just giving you the option to have shift lock, i want to make so when you move your mouse the player turns, and i want to be able turn that on and off.
1 Like
Rare_tendo
(Rare_tendo)
December 25, 2019, 9:30pm
#6
Please search before you make posts:
Inside function CameraModule:Update(dt)
for the CameraModule, you can force shiftlock automatically on
by putting the following code into it
self.activeCameraController:SetIsMouseLocked(true)
If you want rotation you change you can also
GameSettings.RotationType = Enum.RotationType.CameraRelative
or
GameSettings.RotationType = Enum.RotationType.MovementRelative
Using this you can also set up certain conditions for when and if the camera will be forced in situations.
Also you can turn of…
I am making a 3rd person shooter and have figured out how to force mouse lock thanks to this post. How can I force shift lock? . When I force mouse lock, my camera view doesn’t change. What I mean is that when you press shift to mouse lock, your camera goes to the right a bit. However when I force the mouse lock by putting this code in, the camera doesn’t move to the right and I can’t see my gun. Just my head.
self.activeCameraController:SetIsMouseLocked(mouseLocked)
saile515
(saile515)
December 25, 2019, 9:33pm
#7
As i also said, i did find those topics but it didn’t work for me and they are to old to get any help.
1 Like
July 29th isn’t exactly outdated, anything from 2017 should still work as long as it relies on filteringenabled.
I’ve read a bit of the new camera and character control modules source code and came up with an implementation for center-locking the mouse while controlling the camera that also supports shift lock.
Shift lock has properties for developers to disable it in their games, but those properties are read-only in runtime, so you can’t use them to disable shift lock temporarily to stop it from affecting the camera. I’ve found a loophole, though: a StringValue named BoundKeys is available to change whi…
4 Likes
saile515
(saile515)
December 25, 2019, 10:03pm
#9
Thank you so much, i did not find that topic before and it worked, i am sorry that i am a noob.
1 Like