im currently making a crosshair system for my fps framework, however, the crosshair doesnt seem to shrink at the same rate on lower framerates and appears to be getting smaller a lot faster. how can i fix so that it shrinks at the same speed at all framerates?
RunService.RenderStepped:Connect(function(DeltaTime)
if HUDUI.Crosshair.AbsoluteSize.X > CrosshairMinSpread then
CrosshairLastTick += DeltaTime
if CrosshairLastTick >= CrosshairTick then
while CrosshairLastTick >= CrosshairTick do
CrosshairLastTick -= CrosshairTick
local NewSize = HUDUI.Crosshair.Size - UDim2.fromOffset(CrosshairDecreasePerTick, CrosshairDecreasePerTick)
HUDUI.Crosshair.Size = UDim2.fromOffset(math.clamp(NewSize.X.Offset, CrosshairMinSpread, CrosshairMaxSpread), math.clamp(NewSize.Y.Offset, CrosshairMinSpread, CrosshairMaxSpread))
end
end
end
end)
I don’t know if it would work here but maybe try RunService.Stepped or somehow tweens? I know RenderStepped happens before every frame, so I’m assuming it’s locked to the framerate