i made this and it should have worked but the booleans dont work not allowing the script to work
function OnCollisionEnter (collision : Collider) {
if(collision.transform.name=="ballred")
redcol = true;
StartCoroutine("EndLevel");
}
function OnCollistionExit (collision : Collider) {
if(collision.transform.name=="ballred")
redcol = false;
StopCoroutine("EndLevel");
}
function EndLevel() {
yield WaitForSeconds(3);
if(redcol)
{
gameObject.Find("ballblue").AddComponent(Rigidbody);
}
}
why is it not working??