I use these codes to make **"ArrowObj"** become visible when another game object collide with **"HelpStartBox"**, it works:
public var ArrowObj:GameObject;
function Start () {
ArrowObj.renderer.enabled = false;
}
function OnTriggerEnter(col:Collider) {
if(col.gameObject.name=="HelpStartBox"){
ArrowObj.renderer.enabled = true;
yield WaitForSeconds(2);
Application.LoadLevel (1);
Debug.Log("1");
}
}
But when I want to make **"ArrowObj"** become invisible when nothings collide with **"HelpStartBox"**, I don't know what to do. I have tried to put these codes but it didn't work.
else {
ArrowObj.renderer.enabled = false;
}
What should I do?
↧