Hi everyone,
I have a doubt. The documentation states something about this, but it is not clear to me.
I have a code which roughly looks like this:
void Update()
{
//do stuff
}
void OnTriggerEnter()
{
StartCoroutine(MyCoroutine())
}
When my AI enters a trigger, the OnTriggerEnter() method runs. This will run MyCoroutine() which has a WaitForSeconds command. I am guessing that my Update() method will continue running regardless of the coroutine command WaitForSeconds(). If this is the case, how do I make sure that the Update() method does not run during the execution of MyCoroutine()? Basically I want MyCoroutine to have full control over my AI until it completely finished running (thus, after the amount of time specified in WaitForSeconds and after the remaining executions which are run in MyCoroutine()).
Thank you in advance.