- Home /
Question by
Cristinapol · May 02, 2014 at 02:58 PM ·
triggerscript.horror
jumpscare only ince ?
Hello , I have this jumpscare script
#pragma strict
var Monster : GameObject;
function Start () {
Monster.SetActive(false);
}
function OnTriggerEnter () {
Monster.SetActive (true); }
function OnTriggerExit () {
Monster.SetActive(false);
}
but i want the gameobjet that i attached to the script to appear only once because whenever i tag the trigger the game object appears any ideas ?
Comment
Please try to generalize your questions. "Call OnTriggerEnter only once"
Titles specific to your game, and tags such as "horror" are irrelevant to your technical problem, and therefore makes it harder for other people with a similar problem find the solution.
Answer by robertbu · May 02, 2014 at 03:01 PM
Just Destroy this component when you are done with it:
function OnTriggerExit () {
Monster.SetActive(false);
Destory(this);
}
Your answer
Follow this Question
Related Questions
box collider trigger question 1 Answer
trying to enable script on trigger enter 3 Answers
Play sound only once 2 Answers
Help with trigger 1 Answer