Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Question How to make smt like wave spawner but more advanced

Discussion in 'Scripting' started by RgClube, Aug 14, 2020.

  1. RgClube

    RgClube

    Joined:
    Dec 24, 2019
    Posts:
    35
    Hi guys! I want to make smt like a wavespawner, but this should create not only enemies, but for example rotating platforms that can kill you. If the player is not dead, it must proceed to the next stage with a new challenge. I hope I was able to roughly describe what I want to do, I don't even know how to approach this problem and what question to ask on Google. Any sources and tips are welcome :)
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    39,412
    Generally you check each frame if it is time to make a new thing, then make it.

    Look for tutorials on game managers or level managers, or perhaps wave managers.
     
    RgClube likes this.
  3. Yoreki

    Yoreki

    Joined:
    Apr 10, 2019
    Posts:
    2,606
    This is a very broad question, and i'm not entirely sure where your problem lies. I would recommend you to look up how other people implemented their wave spawners. You seem to want exactly that, with minor adjustments. Roughly, a wave spawner that spawns some enemies would take an enemy prefab as input, have some timer, maybe a spawn pattern, and then instantiate those enemy prefabs according to the timer and pattern.
    What you want is exactly that, just with two different prefabs (one for enemies, one for platforms). If there are different platform and enemy types you can make it lists instead. Then simply spawn a random one from that list.. or add more mechanics to it, such that you control what spawns when.
     
    RgClube likes this.