RunService with FPS Unlocker

RunService.RenderStepped:Connect(function(deltaTime: number)
	if isMouseClicked then
		kickPower = math.ceil(math.min(kickPower + deltaTime / MAX_POWER, MAX_POWER))
		anglePower = math.ceil(math.min(anglePower + deltaTime / MAX_ANGLE, MAX_ANGLE))
		
		print(kickPower, anglePower)
	end
end)

Using an fps unlocker causes my power values to go up super fast, I thought using runService instead of a while loop would fix this but it seems I have to do something else?

1 Like

Just wait manually. task.wait(1 / 60), assuming that’s the frame rate you want.

RunService, all of that stuff will speed up with fps unlockers.

RenderStepped, Stepped, all of those loops run once per frame. So yes, when someone uses an FPS unlocker the loop will run more times. You could just do

while task.wait(1/60) do

end

Though if you still want to use a render loop you just need to adjust your formula so it increases at the same speed regardless of the fps the player is running on (this includes below 60 fps)