So ever since the new FPS selector got added into roblox’s settings. I’ve noticed that my gun’s recoil would multiply the higher the frames you were running.
I did a ton of research and came to a conclusion of using RenderStepped DeltaTime to make the recoil caluculations parallel to the clients frames.
I’ve tried every way i could like, dividing the recoil or multiply the recoil but nothings working. This is just very exhausting for me and im losing motivation to keep trying to fix this.
Any fixes or idea’s on how to implement deltaTime would be greatly appreciated.
local function RecoilCamera()
if Module.CameraRecoilingEnabled then
RunService.RenderStepped:Connect(function(DeltaTime)
-- I put in delta time here ^^^^
local Recoil = AddressTableValue(Module.ChargeAlterTable.Recoil, Module.Recoil)
local CurrentRecoil = Recoil * (AimDown and 1 - Module.RecoilRedution or 1)
local RecoilX = math.rad(CurrentRecoil * Math.Randomize2(Module.AngleX_Min, Module.AngleX_Max, Module.Accuracy))
local RecoilY = math.rad(CurrentRecoil * Math.Randomize2(Module.AngleY_Min, Module.AngleY_Max, Module.Accuracy))
local RecoilZ = math.rad(CurrentRecoil * Math.Randomize2(Module.AngleZ_Min, Module.AngleZ_Max, Module.Accuracy))
Knockback:Accelerate(Vector3.new(-RecoilX * Module.ScopeKnockbackMultiplier, - RecoilY * Module.ScopeKnockbackMultiplier, 0))
CameraSpring:Accelerate(Vector3.new(RecoilX, RecoilY, RecoilZ))
CameraSpring:Accelerate(Vector3.new(RecoilX , RecoilY, -RecoilZ))
-- THIS IS THE MODULES SETTINGS JUST INCASE YOU NEED REFERENCE
--[[
CameraRecoilingEnabled = true;
Recoil = 100;
AngleX_Min = 1.13; --In degree
AngleX_Max = 1.13; --In degree
AngleY_Min = -0.12; --In degree
AngleY_Max = 0.12; --In degree
AngleZ_Min = -1; --In degree
AngleZ_Max = 1; --In degree
Accuracy = 0.2; --In percent. For example: 0.5 is 50%
RecoilSpeed = 55;
RecoilDamper = 0.50;
RecoilRedution = 0.5; --In percent.
]]
end)
end
end