I don’t know abt the player being on the center when on shift lock, but here’s a tutorial on how it can be forced:
i was thinking just a different system for the camera instead of shiftlock but thanks
Anyone else have other ideas?
(annoying text amount thing)
There are currently a large variety of custom camera modules available that can help you, for example:
No. Thank you but I’m looking for something different.
What exactly are you looking for then? I’d be happy to help I just need to know what your specific needs are. The topic @hasoco posted above seems like it’d fit your needs, just force enable shift-lock and set the humanoid’s cameraoffset to something like Vector3.new(-1.5, 0, 0) to center the camera, and for the mouse being invisible just disable the mouse icon through UserInputService.
oh wait gimme a second
(ignore this: wfawfgawegawegrhse)
Sorry, but how do I do that? (what i mean is where do i do this: Vector3.new(-1.5, 0, 0) )
(ignore this JFAEIFGJAWEUIGAWG)
It should be Humanoid.CameraOffset
Like this?
Yeah, that looks about right. If it doesn’t work I may have gotten the name wrong, I’m not currently in studio I’m just going off the top of my head
UHHHHH. it completely broke the rest of the script
What do you mean? Could you provide the output and whatever seems to be having an error?
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local plr = game:GetService("Players").LocalPlayer
local char = script.Parent
local hum = char:WaitForChild("Humanoid")
local root = hum.RootPart
Humanoid.CameraOffset = Vector3.new(-1.5, 0, 0)
function shiftLock(active)
if active then
hum.CameraOffset = Vector3.new(1.75,0,0)
hum.AutoRotate = false
RunService:BindToRenderStep("ShiftLock", Enum.RenderPriority.Character.Value, function()
UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
local _, y = workspace.CurrentCamera.CFrame.Rotation:ToEulerAnglesYXZ()
root.CFrame = CFrame.new(root.Position) * CFrame.Angles(0,y,0)
end)
else
hum.CameraOffset = Vector3.new(0, 0, 0)
RunService:UnbindFromRenderStep("ShiftLock")
UserInputService.MouseBehavior = Enum.MouseBehavior.Default
hum.AutoRotate = true
end
end
shiftLock(true)
Workspace.DuckKing_FRS.LocalScript:8: attempt to index nil with ‘CameraOffset’ is the error message
Change the line
Humanoid.CameraOffset = Vector3.new(-1.5, 0, 0)
to
hum.CameraOffset = Vector3.new(-1.5, 0, 0)
Because the variable you have set for the player’s humanoid is ‘hum’
The script works again but the camera has not changed where it is.
Sorry, I didn’t fully read your script that you sent. Inside the shiftLock function, the humanoid.CameraOffset is already being changed. To fix this, you can remove the hum.CameraOffset you wrote, and adjust the one in the function.
The result should look something like:
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local plr = game:GetService("Players").LocalPlayer
local char = script.Parent
local hum = char:WaitForChild("Humanoid")
local root = hum.RootPart
function shiftLock(active)
if active then
hum.CameraOffset = Vector3.new(0,0,0)
hum.AutoRotate = false
RunService:BindToRenderStep("ShiftLock", Enum.RenderPriority.Character.Value, function()
UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
local _, y = workspace.CurrentCamera.CFrame.Rotation:ToEulerAnglesYXZ()
root.CFrame = CFrame.new(root.Position) * CFrame.Angles(0,y,0)
end)
else
hum.CameraOffset = Vector3.new(0, 0, 0)
RunService:UnbindFromRenderStep("ShiftLock")
UserInputService.MouseBehavior = Enum.MouseBehavior.Default
hum.AutoRotate = true
end
end
shiftLock(true)
you can just use userinputservice and do lock mouse to center or something like that.
you do have to run it in a loop cuz sometimes it disables idk why.
note: it wont change the humanod orientation (unless in first person ofcourse)
How can i make the mouse invisible and also make it so shift lock cannot be enabled
To disable the mouse icon, you can use
game:GetService("UserInputService").MouseIconEnabled = false