Search Unity

3D Wave Spawning with different types of enemies

Discussion in 'Scripting' started by LemonRhinoStudio, May 13, 2017.

  1. LemonRhinoStudio

    LemonRhinoStudio

    Joined:
    Apr 16, 2016
    Posts:
    4
    Hello guys! I am currently making a game where waves of enemies spawn and try to attack you, so, I raise the question, how can I make a script where I spawn different types of enemies (Maybe I can choose what type of enemy to spawn each wave?) and when a timer runs out, a new wave will spawn. Also, I have no idea if there a way to do this (I'm completely new to coding), but, is there a way to maybe make the waves loop, but when they loop, the enemies get stronger and they multiply? That would be awesome.

    Thanks everyone for the help in advance!
     
  2. johne5

    johne5

    Joined:
    Dec 4, 2011
    Posts:
    1,133
    you can make a list a enemy types, different types of enemies can be a red cube, blue cube, green cube....
    and create a count down timer. then when count down timer = o then start spawning the next type of enemy. should be easy to do.
     
  3. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    If you can think of it, you can be pretty sure that there is a way to create it (in Unity/coding). If you are very new to coding, you will gain a lot from learning about scripting/programming, and/or how it pertains to Unity.
    The more you learn, the better (and easier) it will be for you to put together your design :)
     
  4. Flynn_Prime

    Flynn_Prime

    Joined:
    Apr 26, 2017
    Posts:
    387
    https://forum.unity3d.com/threads/wave-spawner-errors.470995/#post-3070503

    Here is a spawner I have adapted from a tutorial I followed. The first post contains the original, unedited, and then my adapted version.

    The original can spawn any amount of waves in an infinite loop, but I am trying to edit it to add more enemies per wave. Im getting a simple ( I think) referencing error on my version but shouldn't be too long until it is fixed and working.
     
  5. AlejandroBoss10

    AlejandroBoss10

    Joined:
    Sep 1, 2017
    Posts:
    7
    Did you every get this to work? I'm trying to follow the thread and I'm just like, so which part is working and which isn't lol. Did you happen to get the full script working. I'm having trouble trying to piece together the little snippets of code here and there. Thanks!