I writed script but I can’t activate the gameObjects. This is my script ;
function OnTriggerEnter (col : Collider)
{
if(col.gameObject.tag == "LampTrigger")
{
(gameObject.tag == "First").active;
}
}
I writed script but I can’t activate the gameObjects. This is my script ;
function OnTriggerEnter (col : Collider)
{
if(col.gameObject.tag == "LampTrigger")
{
(gameObject.tag == "First").active;
}
}
I guess what you want is the setActive() function. You are not activating anything in the script you posted.
function OnTriggerEnter (col : Collider)
{
if(col.gameObject.tag == "LampTrigger")
{
if(tag == "First" && !gameObject.activeSelf) gameObject.setActive(true);
}
}