Unity核心原理(2)深入理解FixedUpdate
官方文档链接:Time and Framerate Management
Fixed Timestep
Unlike the main frame update, Unity’s physics system does work to a fixed timestep, which is important for the accuracy and consistency of the simulation. At the start of the physics update, Unity sets an “alarm” by adding the fixed timestep value onto the time when the last physics update ended. The physics system will then perform calculations until the alarm goes off.
和Update主帧循环不同,Unity的刚体系统通过固定的时间来驱动,固定的运算时间是保证模拟结果准确一致的重要因素 。在刚体系统运算开始前,Unity会根据上一次刚体运算完成的时间再加上Fixed Timestep的所设置的值来作为这一次刚体运算时间的限定范围。然后刚体系统会开始计算,直到达到这个时间限制临界点。
You can change the size of the fixed timestep from the Time Manager and you can read it from a script using the Time.fixedDeltaTime property. Note that a lower value for the timestep will result in more frequent physics updates and more precise simulation b