Of course, viewmodel = fps arms.
Anyways, I wrote this viewmodel CFraming code, and I noticed that some stuff would go kinda slow when running. What I mean by slow is that the viewmodel lags a little. Keep in mind that the only stuff in the background are small scripts made by me, so that isn’t causing things to go slower.
Here’s my code:
runServ.RenderStepped:Connect(function(deltaTime)
--//Primary CFraming\\--
Springs.sway = Springs.create()
Springs.walkCycle = Springs.create() --//Currently not in use
if aiming == false then
--Springs.sway.k = 0.05
--Springs.sway.friction = 0.1
--Springs.sway.Speed = 4
local mouseDelta = UIS:GetMouseDelta()
Springs.sway:shove(Vector3.new(mouseDelta.x / 250, mouseDelta.y / 250)) --not sure if this needs deltaTime filtering
elseif aiming == true then
--Springs.sway.Speed = 50
local mouseDelta = UIS:GetMouseDelta()
Springs.sway:shove(Vector3.new(mouseDelta.x / 150, mouseDelta.y / 150))
end
local sway = Springs.sway:update(deltaTime)
Primary.PrimaryPart.CFrame = Camera.CFrame * Main
Primary.PrimaryPart.CFrame = Primary.PrimaryPart.CFrame * CFrame.Angles(0,-sway.x,sway.y)
if PrimaryEquipped == true and aiming == true then
Main = Main:Lerp(CFrameDataPrimary.ads, 0.1)
Primary:SetPrimaryPartCFrame(Primary:GetPrimaryPartCFrame():Lerp(camera.CFrame * Main, 0.6))
elseif PrimaryEquipped == true then
Main = Main:Lerp(CFrameDataPrimary.main, .2)
end
end)
Yes, it uses a separate spring module and settings module, but that shouldn’t be causing the problem.
Yes, I am 100% sure it is not my computer, as for I have a very nice GPU (Radeon RX 570 Series).
Yes, it not my network.
Yes, it isn’t stuff running in the background.
(This code does work and runs almost perfectly most of the time.)
This code is part a 600+ line script, and I have tried disabling that part. Nothing helped.
Any advice would be appreciated!