I try to make an ennemy so that the ennemy be alert, wait 10 seconds, become suspicious wait 10seoncds becore normal again.
I tried with a coyuroutine but it does not work and it something past immédiate from alert mpde to normal mode, to suspicious mode, is it possible I dont understand the coroutine logic or how to write it.
I start my corroutine in the update when certains condition start(and there is a condition so that the suspiciouscourtine does not start when player is in alert mode)
public IEnumerator SuspicousMode()
{
Suspicious = true;
yield return new WaitForSeconds(delay);
Suspicious=false;
yield return null;
}
//
//
public IEnumerator AlerMode()
{
Alert = true;
Suspicious = false;
yield return new WaitForSeconds(delay);
if(mySighListernetTemplate.iSeeYou==false)
{
Alert=false;
StartCoroutine (SuspicousMode());
}
yield return null;
}