So I am using a fully pathed script for making artificial camera recoil:
RunService:BindToRenderStep("cameraRenderUpdate", Enum.RenderPriority.Camera.Value, function()
if tick() - Last > FRate then -- Artificial DeBounce.
if Shoot == true then
print("Shot")
local X = math.rad(math.random(May/2,May))
local Y = math.rad(math.random(-Max,Max))
local Z = math.rad(math.random(-Max,Max)/4)
Target = CFrame.Angles(X,Y,Z)
Recover = CFrame.Angles(-X/1.1,-Y/2,-Z)
Last = tick()
end
elseif tick() - Last > RRate and not (tick() - Last > FRate) then --Check if it is between recovery rate and the fire rate.
print("Recovering")
Target = Recover
elseif tick() - Last > RRate and (tick() - Last > FRate) then -- If it is beyond both.
print("Ended")
Target = CFrame.new()
end
Cam.CoordinateFrame = Cam.CoordinateFrame:lerp(Cam.CoordinateFrame*Target,.1/2)
end)
When the Fire button is held down, it works as predicted, you have some difficulty in keeping the mouse on point. However, when you release the button, you are still in the "Recovery" phase of the recoil. And you just carry on rotating in the recovery direction.
This isn't mean to happen, the 'target' is meant to be set to 0, but "Ended", never prints. Just Shot and Recovery. This is really annoying. Could anyone help?

1 comment
Also, I've tied the Recovery speed to the firing rate.... if anyone has any way of fixing that... plz lemme know.