Skip to main content
deleted 1 character in body
Source Link

So Update is called every frame while FixedUpdate is called on Physics time, which can be modified.

Is it better to depend on FixedUpdate to have optimized game loop so that everything doesn't get called so much.
OR
Is it better to write a coroutine to Update/FixedUpdate and set things there?

public void UpdateStart(){
   StartCoroutine(MyIntervalMethod());
}

 void MyIntervalMethod(){
   for(;;){
   yield return new WaitForSeconds(.2f/*or whatever time interval is suitable here*/);
   }
}

So Update is called every frame while FixedUpdate is called on Physics time, which can be modified.

Is it better to depend on FixedUpdate to have optimized game loop so that everything doesn't get called so much.
OR
Is it better to write a coroutine to Update/FixedUpdate and set things there?

public void Update(){
   StartCoroutine(MyIntervalMethod());
}

 void MyIntervalMethod(){
   for(;;){
   yield return new WaitForSeconds(.2f/*or whatever time interval is suitable here*/);
   }
}

So Update is called every frame while FixedUpdate is called on Physics time, which can be modified.

Is it better to depend on FixedUpdate to have optimized game loop so that everything doesn't get called so much.
OR
Is it better to write a coroutine to Update/FixedUpdate and set things there?

public void Start(){
   StartCoroutine(MyIntervalMethod());
}

 void MyIntervalMethod(){
   for(;;){
   yield return new WaitForSeconds(.2f/*or whatever time interval is suitable here*/);
   }
}
Source Link

FixedUpdate or Subroutine

So Update is called every frame while FixedUpdate is called on Physics time, which can be modified.

Is it better to depend on FixedUpdate to have optimized game loop so that everything doesn't get called so much.
OR
Is it better to write a coroutine to Update/FixedUpdate and set things there?

public void Update(){
   StartCoroutine(MyIntervalMethod());
}

 void MyIntervalMethod(){
   for(;;){
   yield return new WaitForSeconds(.2f/*or whatever time interval is suitable here*/);
   }
}