MILLENNlA
(MILLENNlA)
February 5, 2022, 11:04am
#1
Basically, I’m trying to make a cutscene with camera manipulation. However, if shift lock is pressed, it will turn the player in a wrong direction.
I tried altering the DevEnableMouseLock on the Player and StarterPlayer from the Server, but when I do so, it does toggle the option off, but it keeps them in the shiftlock state (and for some reason, the shift lock icon that appears on the screen disappears).
By it disappearing, I’m referring to this (video from the source thread below):
https://gyazo.com/b12b70fb4b653e69ed46e83e14edaf34
I tried various approaches from previous threads and found no success.
The code needs to disable Shift Lock for a single player and also turn it off if they’re using it; not the entire server.
Any help is appreciated!
Code line/sources:
I’m working on a theme park Queue System, and when a player enters the automated cue I set their CameraMinZoomDistance to 5 and turn off their Shift Lock so that they can’t spin around and are forced to face the right direction. (I can’t just disable auto-rotate because they need to be able to turn around barriers)
The issue I’m facing is that if they have shift lock enabled when they walk into the cue, the script turns it off and the icon disappears yet the controls just act like the player is…
Player.DevEnableMouseLock = false
Forummer
(Forummer)
February 5, 2022, 1:05pm
#2
MILLENNlA
(MILLENNlA)
February 5, 2022, 1:22pm
#3
It says it can be used in a LocalScript, but it is still non-toggleable. Did the exact thing listed in documentation.
MILLENNlA
(MILLENNlA)
February 5, 2022, 1:25pm
#4
Update: Now this pops up:
https://gyazo.com/7105269bc8128b4c58856be9ce3cdd65
Issue is with the line:
player.DevEnableMouseLock = not player.DevEnableMouseLock
local player = game.Players.LocalPlayer
while true do
player.DevEnableMouseLock = not player.DevEnableMouseLock
wait(5)
end
Vlaskoz
(vlaskoz)
February 5, 2022, 1:27pm
#5
I’ve tried this personally (on the server) and seem to have the same issue as you, I think this is intended behaviour.
Allein277
(Allein)
February 5, 2022, 1:27pm
#6
In the “StarterPlayer” folder there is an option to toggle, “MouseLock”. Use that, it’s much easier as you don’t even need a script to this.
MILLENNlA
(MILLENNlA)
February 5, 2022, 1:29pm
#7
Tried that as well just now, this now showed up again:
However, I need the actual action to be toggled off, not the ability to toggle it off.
Allein277
(Allein)
February 5, 2022, 1:30pm
#8
Are you doing that from within a script? Just toggle it in studio, before you play.
Forummer
(Forummer)
February 5, 2022, 1:30pm
#9
Oh, you got the right property, the other user suggested the wrong one.
MILLENNlA
(MILLENNlA)
February 5, 2022, 1:30pm
#10
Tried that as well and it still replicates the same issue. Same error.
1 Like
Vlaskoz
(vlaskoz)
February 5, 2022, 1:30pm
#11
Are you trying to do that from the command bar or what?
Forummer
(Forummer)
February 5, 2022, 1:31pm
#12
Check your thread regarding tables/arrays by the way, I left a fairly lengthy response.
1 Like
MILLENNlA
(MILLENNlA)
February 5, 2022, 1:32pm
#13
I did try this the moment you sent it . However, it’s just not being turned off at all.
Even with your link, the error is the same:
Also, thanks for the reply on my previous thread! I appreciate it.
Vlaskoz
(vlaskoz)
February 5, 2022, 1:36pm
#14
I’m completely lost where you are right now, but how are you trying to toggle the value?
MILLENNlA
(MILLENNlA)
February 5, 2022, 1:37pm
#15
Ignore that bit; I read it wrong. It can actually be used.
Vlaskoz
(vlaskoz)
February 5, 2022, 1:39pm
#17
MILLENNlA:
How?
What we’re trying to say is that you can do this through StarterPlayer
1 Like
MILLENNlA
(MILLENNlA)
February 5, 2022, 1:40pm
#18
MILLENNlA:
Basically, I’m trying to make a cutscene with camera manipulation. However, if shift lock is pressed, it will turn the player in a wrong direction.
The game is meant to support Shift Lock in general; I need it force-toggled off at specific times.
1 Like
Vlaskoz
(vlaskoz)
February 5, 2022, 1:42pm
#19
I see, this seems to be a roblox limitation. I’ve tried it personally (with your example, you can fire a remote event to the server with the player instance and disable the toggle, but I don’t think you can stop the actual ‘shift lock’.)
2 Likes
MILLENNlA
(MILLENNlA)
February 5, 2022, 1:46pm
#20
I’m starting to think the same as well now, but I’m still curious as to how some developers managed to pull it off. I’ve seen some people have public modules open-sourced, but I’m rather trying to make it core-friendly to my system.
Anyway, I’ll keep the thread open incase anyone has any other ideas. Thanks for trying to help out on this tho!
Most likely, the easiest thing to do is just disable Shift Lock. Still have to think it out for a bit.
regexman
(reg)
February 5, 2022, 1:51pm
#21
The best you can really do is make a custom shift lock system due to roblox current limitations.