I need help to make a lock shift type camera that cant be turned off and will have the player in the center of the screen instead of on the left

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:

1 Like

i was thinking just a different system for the camera instead of shiftlock but thanks

1 Like

Anyone else have other ideas?

(annoying text amount thing)

1 Like

There are currently a large variety of custom camera modules available that can help you, for example:

1 Like

No. Thank you but I’m looking for something different.

1 Like

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.

1 Like

oh wait gimme a second
(ignore this: wfawfgawegawegrhse)

1 Like

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)

1 Like

It should be Humanoid.CameraOffset

1 Like

Like this?
image

1 Like

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

1 Like

UHHHHH. it completely broke the rest of the script

1 Like

What do you mean? Could you provide the output and whatever seems to be having an error?

1 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

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

1 Like

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’

1 Like

The script works again but the camera has not changed where it is.

1 Like

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)
1 Like

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