Trigger script does not work.

I cant get my script to work right…
when the player go out of the Boxcollider the object Girl will destroy!?!?

#pragma strict

var flame : GameObject;

function Start () {

flame.SetActive(false);

}

function OnTriggerEnter () { flame.SetActive (true); }

function OnTriggerExit () { flame.SetActive(false);
Destroy(GameObject.FindWithTag("Girl"));
}

1 Answer

1

The reason why the girl was destroyed is because you put girl in the destroy parenthesis.