Question by
MrSteve2 · Aug 13, 2020 at 08:09 PM ·
waitforsecondsdelayienumeratorforloop
For Loop does two loops at once!
Hi all,
I have a rather simple for loop with a delay to play some animations 1 after the other with a .5 delay between each one.
IEnumerator WaitFunc(float delay)
{
for (int i = 0; i < anims.Count; i++)
{
anims[i].SetBool(animName, true);
yield return new WaitForSeconds(delay);
}
}
It kind of works fine, the delay does anyway, but it plays anims for two objects simultaneously, then the next two, then the next two and so on.
Have I done something wrong?
Comment
Your answer
Follow this Question
Related Questions
Wait time Before Camera Switching? 0 Answers
Add points every five seconds 1 Answer
Cannot convert method group expression to IEnumerator 1 Answer
Delay between bullet shot with GetKey 2 Answers
Help with coroutines 1 Answer