Speed Limit for Update()

based on what Unity is showing me and the math,
Update() is not being called every frame (either that or my PC forgot how to do math :rofl:) anyone else experiencing this?

my video proof

seriously though, what’s going on? is this some undocumented limit?

Well you are outputting the getinput() so update is being called. What are you expecting

I would expect the second number on the line (is actually meters per frame not second) to be about 2/3 of what it is. with the numbers unity is outputting my ship would be moving 1.5x its programmed speed.

2/3 of what?

Morning Nina,

So the video shows that Unity is reporting between 90 and 100 FPS, with an offset of 0.41 to 0.43 meters per frame. Using those numbers my ship is reaching acceleration speeds of 36.9 to 43 m/s^2 but the code limits the speed to 25m/s^2. From these numbers I’ve calculated that Update() is only being called 60 times per second, or on about 2/3rds of the frames. If Update were being called every frame I would expect to see the offset closer to 0.28m/f

Is the speed really 25 m/s? (Not s². That would be an acceleration.) Check your Inspector because it overrides the value in your code.

You get values around 0.40 m/f logged into your console.

Assuming you have a frame rate of 100, the offset for a frame would be be 0.6 s. 25 m/s * 0.6 s = 15 m. If the frame rate was consistent, this would mean that your speed is 15 m / s.

The problem is the following: You cannot rely on the display because it does not have much to do with the actual FPS. This is a known problem in Unity. You can infer from it if your game is generally performant but you cannot tell what the frame rate really is.

Your game is fairly small and the FPS in the display looks fine, so it’s not necessary to know the exact frame rate for a frame. If you want to get more information anyway, please refer to the links below.

Log Time.deltaTime along with Time.frameCount into your console. Then do the maths again.

See also:

Thanks for those links Nina, they provided a thread to follow which led me to the answer.

‘While Unity calls Update() as often as it can, the Vsync settings slow down the displayed fps to the display device’s refresh rate’

In my case Unity was running at 90 to 100 fps but my screen slowed things down to 60 fps. That slowdown actually brings the numbers I was seeing into the proper range

for those who are interested here is the link to where I found this info:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms