What is the proper way to delay AI actions in a pokemon clone, so it isn't instant

Orchestrating the “play out” of a series of game events generally involves either:

  • tracking a timer yourself and acting each step out, or

  • using a coroutine to pause between the different phases of doing things.

I like the coroutine approach and a common coroutine runner that accepts other coroutines and runs them one after the other, waiting for each one to complete before moving on.

Coroutines in a nutshell:

Splitting up larger tasks in coroutines:

Coroutines are NOT always an appropriate solution: know when to use them!

Our very own Bunny83 has also provided a Coroutine Crash Course:

https://answers.unity.com/questions/1749615/coroutines-ienumerator-not-working-as-expected.html?childToView=1749714#answer-1749714