Lerping camera CFrame

		local Goal = CFrame.Angles(math.rad(VRecoil.Value), math.rad(math.random(-HRecoil.Value, HRecoil.Value)), math.rad(0))
		for i = 1, 100, 10 do
			cam.CFrame:Lerp(Goal, i)
			task.wait(FireRate/10)
		end

I printed in the loop so I know it runs, but the camera doesn’t move at all and there’s no errors

(please help, i suck at lerping :skull: )

1 Like

to make it easier, just set up parts on the workspace, so that you can lerp into the part cframe.

for i = 1, 100, 10 do
			cam.CFrame = cam.CFrame:Lerp(second part cframe, i)
			task.wait(FireRate/10)
		end

It’s for gun recoil, so the part would have to follow the player’s head wherever they move. It’s not a set position or else I would be using tween service

ah i see, well possibly the Goal part has something wrong in it, but I’ve never done recoil or anything related before so yeah sorry.

You’re fine, I noticed lerping isn’t so common anymore so it’s fairly confusing, aswell as cframe.angles

have you tried debugging like printing the goal and the for i loop?

Yes, I have tried that already

could you tell me what vrecoil/hrecoil value are?

VRecoil is equal to 5, and HRecoil is equal to 2

So like my script works but i think you need to change up something because it’s goes crazy for some reason.

local Goal = CFrame.Angles(math.rad(1), math.rad(math.random(-1,1)), math.rad(0))
local cam = game.Workspace.CurrentCamera
task.wait(5)
for i = 1, 100, 1 do
	cam.CFrame = cam.CFrame:Lerp(Goal, i)
	task.wait()
end

I also think you just needed to do

cam.CFrame = cam.CFrame:Lerp()

Yea, mine was going crazy too when I used the example you sent :skull: . This did work though, instead of just doing CFrame:Lerp()

yeah i thought so. I still use lerp for things so that why I knew.