I need help making it so, if this object dies, set the variable “Target” on another script to the object with the tag “Player”. This is the sliver of code.
function OnTriggerEnter(other : Collider)
{
if(other.gameObject.tag == "Zombie")
{
if (BarrCooldown == false)
{
health -= 1;
StartCooldown();
}
else if (health <= 0)
{
Destroy (parent.gameObject);
other.gameObject.GetComponent(AIFollow).Target = GameObject.FindWithTag("Player").transform;
}
}
}