Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

[closed] How to show FPS (FramesPerSecond) on a GUI?

I don't know where to get the FPS from, but here's what I was thinking:

while true do
 script.Parent.TextLabel.Text = "FPS: "..WhereFPSIs
end

I'm thinking it's in workspace.Camera but maybe not.

1 answer

✓ Accepted answer

Here is what you're looking for, you're welcome

wait(0.1)

--// Settings

local fpsGui = script.Parent
local fpsFormat = "FPS: %.2f"
local updateDelay = 0.5

--// Function

function TrackFPS()
	while (true) do
		local fps = game.Workspace:GetRealPhysicsFPS()
		local fpsStr = fpsFormat:format(fps)
		fpsGui.Text = fpsStr
		wait(updateDelay)
	end
end

TrackFPS()

You can change all the settings but remember to change the loaction of the text as well (fpsGui)

If it worked , accept, thanks!

2 comments

0

Thank you this really helped

0

Why do you have an arbritrary wait at the start?

This discussion is preserved as it was. New answers, comments, and votes are closed.