In the table above, you see deltaTime is going along steadly at 0.25, but then suddenly it spikes up 380% to 0.95 then drop down 73% to 0.25. The visual effect of the spike would be everything suddenly moving 380% more units than the previous frame.
The smoothDeltaTime, since the values are averaged over several frames, only sees a jump of 193%. And when it does drop back down to normal, the drop is only 51%. Now, while there will still probably be a visually noticible “hitch”, it won’t be as drastic as the deltaTime hitch. The hitch will have been spread, or “smoothed”, out over several frames.
I agree, it would be nice if some of the descriptions where expanded on, but hopefully my little description will help in the mean time (and is not too far off the actual mark)
Just for information if any docs manager comes by this section :
April 2012 (4 years later), and the docs about it are still vague. I had to Google search “smoothDeltaTime” to find out further explanations here.
You can have manual for offline use + an online version and a separate wiki just for online where users can add things. Many applications use this sort of method and it works wonderfully.
Thanks DGuy for the useful information, and thanks n0mad for bumping this
Unity docs should really be taken more seriously by the Unity guys. The amount of time that a Unity user has to lose to get information about things that should be well documented is absurd. Online searches, forum help, direct trial and error testing. And all this not to find solutions to issues, but just to understand undocumented (or badly documented) API. If we count these hours as working hours, Unity costs a LOT more than 1,500$.
why can’t they just add a comments section to the docs like they have on php.net?! everyone could add clarifications and examples and everyone on the planet would benefit greatly!
Not that the resources aren’t great as they are, but having something a bit more expanded than this kinda (understandably) rushed doc note would be great.
Where they seem to use f=0.2 (In Unity 5 at least)
In the end I had to implement it myself because Time.smoothDeltaTime seems to be updated also when the timeScale is zero causing it to be nearly zero after my game was unpaused.
The documentation almost never has the exact math that goes into any of its built-in methods and members, so this is just one of a million different things that have some magic going on behind the scenes, and no reason (or at least, no more than normal) to update the documentation. Anyways, they’ve been more focused on those promotional videos that they call tutorials.
Smooth delta time does exactly what it says.If there is a significant jump in the framerate you’re running, SmoothDelta time will report values closer to your targetFPS but weighted by the amount of frame loss. deltaTime will give you the actualy time difference.
Seems like a matter of preference. What should happen if someone’s machine lags? Should it skip (deltatime) and be caught-up the next frame, or should it go into slow-mo for a few frames(SmoothDeltaTime)? I’ve never tried SmoothDeltaTime, though.