I want to turn on/off multiple light sources (torch with flame effect) when the player enters certain areas within the game. I’m using the following script which works fine on a single item but I can’t figure out how to make it affect all the objects/flames at the same time?
#pragma strict
var torch : GameObject;
function Start ()
{
torch.SetActive(false);
}
function OnTriggerEnter()
{
torch.SetActive(true);
}
function OnTriggerExit()
{
torch.SetActive(false);
}
(The items/objects are prefabs and untagged)
Any ideas guys?