Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

HELP NEEDED ON RESPAWNING

Discussion in 'Scripting' started by ScottGameDevelopment, Jul 28, 2020.

  1. ScottGameDevelopment

    ScottGameDevelopment

    Joined:
    Apr 7, 2020
    Posts:
    42
    Hello Community im kinda confused on respawning my enemy prefab and all i want it to do is when i shoot it another one will spawn in like straight after and im sorry but i dont have a script this time. Note im using C# Visual Studio if not sure what im using.

    Thank You
     
  2. AnthonySharp

    AnthonySharp

    Joined:
    Apr 11, 2017
    Posts:
    88
    Create an OnDie() function in your enemy's script that gets called when the enemy dies. In the OnDie() function, call Instantiate(yourenemyprefab), either at a fixed or random location etc.
     
  3. Yoreki

    Yoreki

    Joined:
    Apr 10, 2019
    Posts:
    2,590
    Please dont Capslock your title. All threads are equally important and will receive help should someone know an answer. Writing it in caps wont make this process any faster by implying that the thread is more important than others. If anything, this effect (whether intentional or unintentional) may turn people away from helping.
     
    DaDonik and Joe-Censored like this.
  4. DaDonik

    DaDonik

    Joined:
    Jun 17, 2013
    Posts:
    258
    That is not true, if i see an all caps thread, i simply refuse any help. :cool:

    Oh and i only care to mention, because the OP made several threads in this fashion already and it has been annoying me for days.
     
    Joe-Censored likes this.
  5. ScottGameDevelopment

    ScottGameDevelopment

    Joined:
    Apr 7, 2020
    Posts:
    42
    Look
    Look if your not happy then dont reply at all useful tip