non responsive booleans

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??

Maybe ballred does not exist. Double check its name in the heirarchy.

it is

No. collision.name

No. GameObject.Find

Your if statement indentation is also ambiguous.

still does not work can i just get the complete script?

It’s your script. Nobody else has it.

try to use Trigger

I dont know why this works, and OnCollisionEnter dont. But this is it!
Try it.

OnCollisionExit

not

OnCollistionExit

ops another mistake post. sorry.

also…

function OnCollisionEnter (collision : Collision)

not collider