i made this and it should have worked but the booleans dont work not allowing the script to work Code (csharp): 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??
try to use Trigger http://unity3d.com/support/documentation/ScriptReference/Collider.OnTriggerEnter.html I dont know why this works, and OnCollisionEnter dont. But this is it! Try it.