Camera bug RenderStepped

Hello developers So I’m trying to make the camera follow the player when he crouches. Yes, it works, but it makes another bug that makes the camera go very behind the body.

RNS.RenderStepped:Connect(function()
	local objectSpace = (HRP.CFrame + Vector3.new(-1, 1.5, 0)):ToObjectSpace(head.CFrame)

	hum.CameraOffset = objectSpace.Position
end)
1 Like

You’re subtracting 1 in the global Z direction, you want that to be local:

local objectSpace = (HRP.CFrame * CFrame.new(-1, 0, 0) + Vector3.new(0, 1.5, 0)):ToObjectSpace(head.CFrame)

now its going to the right

That’s because the CFrame.new changes the X axis, as per the original code. You’ll have to mess around with the axis. I’m guessing you want CFrame.new(0, 0, 1) but that’s up to you

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