Can't figure out how to change between RotationTypes

Trying to make a custom shift lock system, and I can’t get the RotationType to change between CameraRelative and MovementRelative. Here’s the script:

local uis = game:GetService(‘UserInputService’)
local rs = game:GetService(‘RunService’)

local toggle = false
local togglekey = Enum.KeyCode.LeftControl

uis.InputBegan:Connect(function(key, typing)
if key.KeyCode == togglekey and typing == false then
toggle = not toggle
end
end)

rs.RenderStepped:Connect(function()
if toggle == true then
UserSettings().GameSettings.RotationType = Enum.RotationType.CameraRelative
else
UserSettings().GameSettings.RotationType = Enum.RotationType.MovementRelative
end
end)

I’ve been looking in the forum for an answer for a while, but I haven’t found any helpful topics. I don’t even know if it’s possible to change. Any tips?

Also I don’t know why the code got pasted like that. It’s kinda harder to read like this but I dunno how to fix it.

1 Like

Yeah so nevermind it randomly works now??? I didn’t even touch the script it just decided to work properly

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.