var object : GameObject;
var sound : AudioClip;
function OnTriggerEnter(Target:Collider)
{
if(Target.tag == "LurkerEnd")
{
Destroy(object);
audio.PlayClipAtPoint(sound, transform.position);
}
}
var object : GameObject;
var sound : AudioClip;
function OnTriggerEnter(Target:Collider)
{
if(Target.tag == "LurkerEnd")
{
Destroy(object);
audio.PlayClipAtPoint(sound, transform.position);
}
}
If I understand correctly, change line 8 to:
Destroy(Target.gameObject);
If it does work, put a Debug.Log() just inside your OnTriggerEnter(). That will tell you if you have an issue getting the trigger to work, or if you have a tag issue. And you don’t need ‘object’ after this change.