idk if this has been solved yet, but I’ve worked on sophisticated systems for recoil and recoil return.
What you want to do is add more clarity to your recoil system. I mean like add a table containing your recoil pattern. It could look something like this:
myRecoilPattern = {
{10, {.2,0,.8},{-.2,0} },
{20, {.5,0,.5},{-.5,0} },
{30, {.4,0,.5},{-.4,0} },
}
--// for each index in myRecoilPattern, below is the template
--// {tillWhichBullet, {upRecoil, rightRecoil, forHowLong}, {upReturn, rightReturn, forHowLong?} }
so what you could do in your self.Recoil:Fire() line is
local function getCalculatedRecoil(whichBullet) --// note that this number depends on the burstCount, not the position of the bullet in the magazine.
for _, recoilTable do
if whichBullet < recoilTable[1] then
return recoilTable
end
end
end
while mouseHeld do
if fireRateChecksOut then
self.Recoil:Fire(getCalculatedRecoil())
end
runS:Wait()
end
--// then wherever you are receiving that signal,
local recoilTable = --//receive this through signal
local timePassed = 0
local direction = 0
local myRecoilLoop = runS.OnRenderStep:Connect(function(dt)
timePassed += dt
if timePassed > recoilTable[2][3] then
direction += 1
end
if direction == 0 then
cam.CFrame *= CFrame.Angles(recoilTable[2][1] * dt,recoilTable[2][2] * dt)
elseif direction == 1 then
cam.CFrame *= CFrame.Angles(recoilTable[3][1] * dt, recoilTable[3][2] * dt)
end
end)
this is only to show you the general structure of more sophisticated recoil systems. I’m sure you can add more to it yourself.
Have Fun!
ALSO REMEMBER TO DISCONNECT THE RENDERSTEP AFTER USE myRecoilLoop:Disconnect()