I want the recoil to keep going up once shot but for some reason it goes up only to a certain length, and how would i make it recover slowly when the player stops shooting something like how valorant does. Im not sure if i should use a different spring module im not sure how i would use quenty’s module would i use timeskip(dt) in the renderstepped then impulse and use that idk
local function onHeartbeat(self, tool)
if firing and tool:GetAttribute("Ammo") > 0 then
if os.clock() - lastShot < 0.1 then return end
effectsManager.onWeaponFired(tool, player)
self.recoilSpring:shove(Vector3.new(self.recoilSpring.Position.X + 0.05, 0, 0))
--remoteManager:FireServer("WeaponFired")
lastShot = os.clock()
end
end
local function applyCameraRecoil(self, deltaTime)
local recoilSpring = self.recoilSpring:update(deltaTime)
-- Calculate the new camera position by subtracting the offset
local newCameraPosition = lastSpringPosition + Vector3.new(-0.03, 0, 0)
-- Update the camera's CFrame
workspace.CurrentCamera.CFrame = CFrame.new(self.recoilSpring.Position - newCameraPosition) * CFrame.Angles(recoilSpring.x, 0, 0)
-- Update lastSpringPosition
lastSpringPosition = newCameraPosition
end