Home > Software design >  Unity- should moving object in 'X' Axis be in Update or fixedUpdate.?
Unity- should moving object in 'X' Axis be in Update or fixedUpdate.?

Time:04-10

i know physics should be in fixedupdate. but what about moving the object in 'X' Axis forever, does it also count as physics movement?

    void Update () {
    Vector3 temp = transform.position;
    temp.x  = speed * Time.deltaTime;
    transform.position = temp;
}

CodePudding user response:

Putting it in Update should be fine

  • Related