Help making gun recoil this is driving me insane

I’ve been looking at post, after post, after post and I cannot find a single one to help me resolve this issue :sob:


basically I just want to make gun recoil, in the sense that there can be both vertical and horizontal recoil, of which, after shooting, the system should wait a bit before the camera eases back to its original position.

So I tried that, oh boy.

So far I’ve just been using lerp to move the camera’s CFrame, but the issue is that the camera cant move at all during this, thus you cant look around whilst experiencing the recoil to target your next enemy, which is like really annoying.

As of now I dont really even have a system, it was more of just a test to see how changing the CFrame of the camera would work, Im not asking for an entire system, I would just like some guidance on this cause for the life of me I cant figure it out :sob:

Thanks in advance,

1 Like

You can use this method if you want to offset the camera without changing it’s original CFrame, change the offset variable

local oldOffset = CFrame.new() -- Don't edit this!
local offset = CFrame.new() --update this variable to your liking to offset camera without changing the original camera CFrame.

-- (Optional): Will accumulate the time in seconds since the script started
local t = 0

game:GetService("RunService").RenderStepped:Connect(function(delta)
	-- (Optional): Accumulate the time in seconds
	t += delta
	-- Cancel out the offset we applied in the previous frame
	cam.CFrame *= oldOffset:Inverse()
	-- Apply the new offset
	cam.CFrame *= offset
	-- Store the offset we have applied so we cancel it in the next frame
	oldOffset = offset
end)
1 Like

you should check out what this person did in their fps tutorial Designing an FPS Framework: Beginner’s guide [PART 2] i’m not sure whether you are making an fps or a third person shooter but I have been able to implement it into a third person system as it is mainly just camera manipulation