- Home /
Question by
Henrik213 · Dec 15, 2013 at 12:43 AM ·
collisiontriggermodelboxcollider
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"));
}
Comment
Answer by FPSworrior · Dec 15, 2013 at 12:56 AM
The reason why the girl was destroyed is because you put girl in the destroy parenthesis.
Your answer
Follow this Question
Related Questions
Trigger Enter and Exit not working properly? 2 Answers
Destroy On Collision will not work with spawned AI 1 Answer
Ignore collision on tag not working 2 Answers
Sphere Collider Trigger not being Triggered on Object with two Colliders 0 Answers
Detect collision/trigger between two body without rigidbody? 3 Answers