Issue with using two StartCoroutines in one script

2018-05-16 10:56:52

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;

}

The correct spelling is StartCoroutine( ... )

From Unity: MonoBehaviour.StartCoroutine

  • The correct spelling is StartCoroutine( ... )

    From Unity: MonoBehaviour.StartCoroutine

    2018-05-16 13:01:41