Skip to main content
2 of 2
removed unrelated tags
user avatar
user avatar

Issue with using two StartCoroutines in one script

I'm having a Issue with trying to use multiple StartCoroutines within my Script. I'm having an error at line 50 where is says StartCoroutine does not exist in the current context

void OnCollisionExit(Collision theCollision) {
    if ((theCollision.gameObject.tag == "Boost")) {
        movementspeed = 13000;
        //StartCoRoutine (Delay2 ());  error here
        Destroy (theCollision.gameObject);
    }
}

IEnumerator Delay2 () {
    yield return new WaitForSeconds (1);
    movementspeed = 10000;
}
    


void OnCollisionEnter(Collision theCollision) {
    if ((theCollision.gameObject.tag == "Wall")) {
        movementspeed = 5000;
        StartCoroutine (Delay ());
    }
}

IEnumerator Delay() {
    yield return new WaitForSeconds (3);
    movementspeed = 10000;
}