Hi i'm trying to make a first person shooter and on my gui i'm not entirely sure how to detect framerate. I've tried Renderstep and game.Workspace:GetRealPhysicsFPS
but nothing is seeming to work without it giving me 0 or 1#.INF
Here is my script:
local FPS = 1/game:GetService("RunService").RenderStepped:wait() script.Parent.Text = FPS
For some reason all it shows is 1#.INF and never changes.
EDIT: Before you ask if i've looked at the wiki or googled it, yes. but most of its "How to increase framerate while playing roblox" and on the wiki it just tells me that renderstep is just another way to utilize wait()
You should loop it.
local obj = script.Parent; local RenderStepped = game:GetService("RunService").RenderStepped while true do obj.Text = RenderStepped:wait()^-1; end;
If you're not sure, x^-1
is the same as 1/x
, but it does a check for 0.
You detect it locally using GetRealPhysicsFPS