Version: Unity 6 (6000.0)
Language : English
Object-oriented development
Per-frame updates

Managing time and frame rate

It’s important to understand how Unity handles time to ensure your gameplay remains stable. Updates occur at regular time intervals to capture changes to character positions, health status, scores, and so on. If your code makes changes in the wrong update loop or doesn’t allow for variations in time, effects like movement might be too fast, too slow, or jumpy instead of smooth.

The Time class contains properties through which you can get and in some cases set various time-related measurements and settings. Refer to Time in the Scripting API reference for a complete list of the properties and their meanings.

Topic Description
Per-frame updates Updates which happen once per frame and whose frequency therefore depends on frame rate.
Fixed updates Updates which happen at a configurable fixed time interval.
In-game time and real time The configurable relationship between in-game time and real time and the potential effects.
Handling variation in time Techniques Unity uses to compensate for variations in time and frame rate and to limit the effects of one-time delays.
Capture frame rate Compensating for frame rate when recording video of gameplay.

Additional resources

Object-oriented development
Per-frame updates
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961