首页 文章

Unity中的运动每隔几秒就会滞后一次,运动看起来很跳跃

提问于
浏览
1

我在Unity做了一个游戏,苹果从上到下掉落 . 问题是它们不能顺利进行 . 在每一秒钟他们都像这样蠢蠢欲动:

向下,向下,向下,向上,向下,向下,向下,向上,向下,向下,向下......

看起来每隔几秒就会跳起来然后像它应该的那样掉下来然后又跳起来......

代码很简单:

function Update () {
    transform.position.y -= speed * Time.deltaTime;
}

我尝试关闭VSync,尝试使用FixedUpdate(使用Time.fixedDeltaTime),LateUpdate,Time.smoothDeltaTime,transform.Translate,MoveTowards,Vector3.Lerp,打开RigidBody的Interpolate,尝试更改时间设置,即使添加平面也没有任何帮助在新场景中并将此脚本附加到Plane .

Before a moment I tried to attach rigidbody2D to Quad and see what will happens and there is still lag when Quad is falling down even without any code. This makes me wondering why this is happening?

1 回答

相关问题