It’s more so when you touch an object with the tag “light” then any object with the tag “enemy” will become active and move towards the player.
#pragma strict
function Start ()
{
GetComponent("ENEMY").active = false;
}
function Update ()
{
}
function OnCollisionEnter (collision : Collision)
{
while(collision.gameObject.tag == "light")
{
GetComponent("ENEMY").active = true;
}
GetComponent("ENEMY").active = false;
}