Crosshair not resizing correctly on different framerates

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?

video:

External Media

code:

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)
1 Like

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

it running on every frame is what i want tho

1 Like

bumping still need an answer for this

whats wrong? nothing changes in the video

well then it’s going to be different obviously. the lower in framerate it is the less it will update

if u look a little closer at the crosshair, on 60 fps it doesnt slowly grow over time as i shoot whereas on 240 it does
heres some screenshots:
240:
image

60:
image

but you can see how ive already written code to counteract that using deltatime