RPG Action Progress Bar always same speed

Hello,
I make an RPG with turn based combat where the turn ordere is calculated based on the character speed.
A Coroutine checks if a character is ready. If no character is ready it increases all characters Action Progress bar by a value ( different for each char) and starts the coroutine again as long as no character is ready for action. My Problem is now that i wanted to test it and every time i start the play mode, the action bars recharge at a different speed. I think its because of framerate and other stuff going on. but this will be a problem with different devices as some people will wait longer than other. Tried to solve this with Time.deltaTime but its not exactly working. Can someone have a look on my Code?

IEnumerator WaitForCharactersReady()
    {

        float tickTime = 0.02f;

        if (readyCharacters.Count == 0)
        {
            for (int i = 0; i < playerTeamControllers.Length; i++)
            {
                playerTeamControllers*.characterStats.IncreaseActionProgressByOneTick();*

playerSpotUis_.SetActionBar((int)playerTeamControllers*.characterStats.actionProgress);_
_if (playerTeamControllers.characterStats.isReadyForAction())
{_

_readyCharacters.Add(enemyTeamControllers);
}*_

}
for (int i = 0; i < enemyTeamControllers.Length; i++)
{
enemyTeamControllers*.characterStats.IncreaseActionProgressByOneTick();*
enemySpotUis_.SetActionBar((int)enemyTeamControllers*.characterStats.actionProgress);_
_if (enemyTeamControllers.characterStats.isReadyForAction())
{_

_readyCharacters.Add(enemyTeamControllers);
}
}
while(tickTime >= 0.0f)
{*

tickTime -= Time.deltaTime;
yield return null;_

}

StartCoroutine(WaitForCharactersReady());
}
}

Hi, I don’t understand your in-game logic, but I can help with the coroutine stuff.

You can try using “yield return new WaitForSeconds()” to wait a specific amount of time.

But alternatively I would recommend you using “yield return new WaitForFixedUpdate();”. It will run alongside FixedUpdate for 50 times a second. That should solve your issue of different characters incrementing by variable amount.

That said, regardless of the way the coroutine is running, it should increase all character ticktime evenly, so my guess is that IncreaseActionProgressByOneTick(); has some issues as well.

If I would have to do something similar, I would do it somewhat like below

`IEnumerator ActionCoro()
{
while (!gameOver)//Or just true
{
if(readyCharacters.Count <= 0)
{
for ()
{
//go through all the player characters
}
for ()
{
//go through all the enemy characters
}
}

        yield return new WaitForFixedUpdate();
    }
}`