Coroutine for animation - when is it better than update()

So i have an object that moves linearly in small increments creating a straight line animation. When it has reached its destination the object is destroyed. Now I want to know If i use a coroutine for this code, wouldnt it be approximately the same as update? because the code will run similarly till it reaches its destination.

No, it’s not the best idea =)
Update is just good. Coroutines should be used for a different types of actions.

2 Likes

If the only thing you doing in your Coroutine is yield return null (wait for next frame) then you should just call this method from update each frame. Only if your getting fancy with whats going on in that coroutine and waiting on other yield instructiosn (waitForseconds for example) would I bother with an actual coroutine

1 Like