Question by
Crossroad1000 · Nov 28, 2015 at 02:51 PM ·
gameobjectnameactivateother
Activate other gameobject
Hi, I made this scipt to activate an other gameobject. Can someone tell me what I am doing wrong? This is the scipt that I made:
function OnTriggerEnter (col : Collider) {
if(gameObject.name == "Cylinder" || test == 3)
{
other.gameObject.name == "wall"; {
other.gameObject.SetActive(true);
Application.LoadLevel (Application.loadedLevel + 1);
}
}
Comment
Answer by pekalicious · Nov 28, 2015 at 11:24 PM
other.gameObject.name == "wall";
I'm assuming you want to check if this game object is named "wall", in which case, you are missing the "if" statement:
if (other.gameObject.name == "wall") {
other.gameObject.SetActive(true);
Application.LoadLevel (Application.loadedLevel + 1);
}