Update&和有什么区别?在Unity中的FixedUpdate吗? [英] what is the difference between Update & FixedUpdate in Unity?

查看:224
本文介绍了Update&和有什么区别?在Unity中的FixedUpdate吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

UpdateFixedUpdate方法之间有什么区别?何时应使用这些方法?

What is the difference between the Update and FixedUpdate methods, and when should these methods be used?

推荐答案

来自

更新每帧运行一次. FixedUpdate可以运行一次,零次或多次 每帧次,具体取决于每秒多少物理帧 在时间设置中设置,以及帧速率的快慢.

Update runs once per frame. FixedUpdate can run once, zero, or several times per frame, depending on how many physics frames per second are set in the time settings, and how fast/slow the framerate is.

另请参阅同一论坛中duck的答案,以详细说明两者之间的区别.

Also refer to the answer given by duck in the same forum for a detailed explanation of the difference between the two.

因此,在应用时应使用FixedUpdate 力,扭矩或其他与物理学相关的功能-因为您知道 它将与物理引擎本身完全同步地执行.

It's for this reason that FixedUpdate should be used when applying forces, torques, or other physics-related functions - because you know it will be executed exactly in sync with the physics engine itself.

而Update()可能会因物理引擎而变化,或者 更快或更慢,具体取决于图形的负载量 在任何给定时间使用渲染引擎-如果用于 物理-会相应地产生不同的物理效果!

Whereas Update() can vary out of step with the physics engine, either faster or slower, depending on how much of a load the graphics are putting on the rendering engine at any given time, which - if used for physics - would give correspondingly variant physical effects!

这篇关于Update&和有什么区别?在Unity中的FixedUpdate吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆