- Home /
Syncronize animation and game logic in turn-based strategy
ok. we're developing a turn-based strategy and faced the problem. in a certain moment animation should start, hit animation for example, and game must stops. the problem is i cant determine how long animation lasts when using Mecanim. how can i do such thing as stop the game while animation clip is playing?
Sorry for poor english
Answer by OctoMan · Nov 06, 2015 at 06:05 PM
I would just trigger the animation or use a bool once you need them to play. Also set another bool "IsPlaying" to true in mechanim and once you go back to Idle you set it back to.
So only when that bool is false, do the next step/turn.
public Animator anim;
if(anim.GetBool("IsPlaying") == false)
{
//do next step
}
Something like this.
Your answer
![](https://koobas.hobune.stream/wayback/20220612044051im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
animation to animator [mecanim] 1 Answer
Remove all location transformation from animation clip 1 Answer
Is there a way to change the WrapMode of all Animations in a Mecanim Animator? 1 Answer
Edit AnimationClip during runtime from script 0 Answers
Does character bones and rigs should be according to mecanim clip ? 0 Answers