- Home /
 
how do i make an enemy appear then immediately dissapear?
I'm making a horror game and i want to know how to do this to add some jump scare moments please help :)
Answer by drak0 · Aug 11, 2012 at 10:55 AM
You can use a trigger , and if the player has entered the trigger zone , instantiate the enemy, make him do something, then destroy him.
 
function OnTriggerEnter(col : Collider){
     if(col.gameObject.tag == "Player" && !enemySpawned){
           //instantiate the enemy where you want it and destroy it after some time
         enemySpawned = true;
    }
 }
        
                
               
I believe the script would go on an empty game object that would be a trigger by having a big box collider on it. This collider would be basically like a button that once the player touches it, it triggers the other stuff.
http://docs.unity3d.com/Documentation/Components/class-BoxCollider.html
Your answer
 
             Follow this Question
Related Questions
Enemy appear / disappear 1 Answer
object dissappear and reappear 1 Answer
Distance activated GUI 1 Answer
Make GUI box appear and disappear 2 Answers
I want to make text appear for a few seconds and then disappear. 2 Answers