Hey everyone!
So my issue is that for my invincibility powerup that I am currently using, I have a coroutine which works as follows:
IEnumerator InvincibleActivate() {
if (!PC.GetInvincible()) { // If not invincible already, become invincible.
PC.SetInvincible (true);
yield return new WaitForSeconds (10);
PC.SetInvincible (false);
}
}
The only problem with this, is that it’s possible for two “invincibility” powerups to spawn at the same time. As such, a user could pick up two powerups, but would still only be invincible for 10 seconds.
Is there any way that I can get the remaining time left in the “waitforseconds” and add it to a new counter? Or am I going about this particular problem completely wrong?