How would I move the camera down in first person but still keep player control

What do you want to achieve?
I want to move the camera down while I crouch to give more feedback on when you’re crouching
What is the issue?
I can’t seem to figure out on how to do this
What solutions have you tried so far?

  1. I’ve tried multiplying the CFrame with Vector3 but yielded no luck
  2. I’ve tried matching the camera with the head but ended up spinning around

Use Humanoid.CameraOffset for this.

I did a bit of research but I can’t seem to find how to use it. Could you explain?

Something like:

Humanoid.CameraOffset = Vector3.new(0, -1.5, 0)

Just adjust it until it looks right.
Also, here’s the documentation for it: Humanoid | Roblox Creator Documentation

When I put the code in, my camera just shakes when I crouch.

Humanoid.CameraOffset = Vector3.new(0,5,0)

Did I put it in right?

Vector3.new(0,5,0) would be up, it should be a negative number.

I seems that every other tick it snaps back to it’s original position even though I turned it down

*creating a shaking effect

Could I see the code you are using?

 if Input.KeyCode == Enum.KeyCode.LeftControl then
		Humanoid.WalkSpeed = 8
		crouch = true
		repeat wait()
			if (moveW == true) or (moveA == true) or (moveS == true) or (moveD == true) or (moveUp == true) or (moveDw == true) then
				state = 2
			else
				state = 1
			end
			print(state)
			ce:FireServer(state)
			Humanoid.CameraOffset = Vector3.new(0,-1,-0.25)
		until crouch == false
		ce:FireServer(0)
	end

Then something like this would probably be correct:

if Input.KeyCode == Enum.KeyCode.LeftControl then
		Humanoid.WalkSpeed = 8
		crouch = true
		Humanoid.CameraOffset = Vector3.new(0,-1,-0.25)
		repeat wait()
			if (moveW == true) or (moveA == true) or (moveS == true) or (moveD == true) or (moveUp == true) or (moveDw == true) then
				state = 2
			else
				state = 1
			end
			print(state)
			ce:FireServer(state)
		
		until crouch == false
		Humanoid.CameraOffset = Vector3.new(0,0,0)
		ce:FireServer(0)
	end

Everytime I crouch/uncrouch the camera just snaps back to it’s original spot

Are you wanting to tween the camera down when crouching and back up when uncrouching?

I honestly don’t care it it’s tweened or not, I just want the camera moved down

*So no

Using this script works perfectly fine for me, so I’m not sure what your problem is…?

game:GetService("UserInputService").InputBegan:Connect(function(key)
	if key.KeyCode == Enum.KeyCode.LeftControl then
		game.Players.LocalPlayer.Character.Humanoid.CameraOffset = Vector3.new(0,-1,0)
	end
end)

game:GetService("UserInputService").InputEnded:Connect(function(key)
	if key.KeyCode == Enum.KeyCode.LeftControl then
		game.Players.LocalPlayer.Character.Humanoid.CameraOffset = Vector3.new(0,0,0)
	end
end)

Do you have some sort of camera system? Try searching for a script using CameraOffset using Ctrl+Shift+F.

1 Like

I honestly don’t know how this slipped by me but you are a life saver, at least I know a new search keybind

1 Like

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