- Home /
Turn-type gameplay and wait until the end of actors movement\action
Hello,
i was playing with turn-gameplay style (like roguelikes or so) and i was wondering if there is a way different from the 2D-Roguelike example to make a turn-based action\movement game where, the game engine, before moving to the next actor, has to wait until the first actor finished his animation movement (not exactly the animation, but the smooth movement action itself).
Can you suggest me a pattern or some ideas to achieve something like that?
Thanks everyone
Answer by NickJVaccaro · Oct 30, 2017 at 02:49 PM
I'm not sure how the 2D-Roguelike example does it, so it may be the same as what I'm about to suggest. One way to accomplish this is to use a coroutine. You could have all of the animations, etc. take place within a coroutine and then once it's all done, you just have the coroutine call a "Continue()" function or something similar, and that causes everything to continue.
Answer by Jamsus · Oct 30, 2017 at 03:39 PM
Ok i'll dig a bit more into coroutine for similar examples, if you have some similar examples i'll be looking into them.
My idea was
GameManager.cs ... ... Update() < iterate throu actors and get their action, when the actor is the player, wait for input < when the action is chosed, perform it and wait for the end, then go to next actor
the problem was "wait for the end", because doing stuff immediately the engine works, but when i made everything wait for the action to finish i started having some troubles
Thanks and sorry for bad english
Your answer
![](https://koobas.hobune.stream/wayback/20220612142153im_/https://answers.unity.com/themes/thub/images/avi.jpg)