How to prevent lerping overriding user choices?

Sorry if the title is kind of weird.

Anyways, I’m once again, attempting smooth recoil! I have a pretty nice camera spring module which functions perfectly fine.

The thing is, I want the camera to go back down after the player is done firing, and to do this, I lerp the camera cframe to the cframe from when they started firing, but this overrides the player’s choice. Is it possible to prevent that? Can I find the previous Y position from the camera?

My code:

orcCFrame = camera.CFrame --//Snapshot cframe


mouse.Button1Up:Connect(function()
	if Firing == true then
		Firing = false
		
		for i = 0, 1, 0.2 do
			wait()
			camera.CFrame = camera.CFrame:Lerp(CFrame.new(0,orcCFrame,0), i)
			runServ.RenderStepped:Wait()
		end
	end
end)

And please, don’t tell me to look into springs, I have decided that they’re too complex and just give me errors.

What I mean by overriding player choice, is that when I move my camera and stop firing, it makes me look to the previous camera CFrame

Any help would be appreciated! :smiley:

Simply change the CameraType of the Camera that the player is using to “Scriptable” while lerping, and then changing it back to “Custom” afterwards.

That won’t quite work, as for I am trying to do weapon recoil, and it would make it weird to not be able to move the camera while firing

Try moving the gun instead? I’m no expert on this kinda stuff, so sorry for my lack of expertise.

I already move the gun with an animation, I just want to shove the camera

You could try making a table the saves the previous camera position and then when the recoil is done it reverts back to that position that was in the table (also will remove it so it can loop again)

The only problem I have is the lerp overriding the player’s choice of moving the camera. I have no problems shoving it.

Sorry, wish I could help more, I haven’t really looked into lerping that much yet.

It’s fine. I think I’ll skip over moving the camera back down. Thanks for your guy’s replies!