How Can I Autogenerate Objects?

Discussion in 'How Can I...?' started by montasli, Nov 16, 2020.

  1. montasli

    montasli Boxer

    Joined:
    Nov 14, 2020
    Messages:
    2
    Likes Received:
    0
    Im currently trying to make an endless runner game. Its going pretty well so far but at the moment there are always the same 3 scence played. Now im wondering how i can randomize things up a little bit by autogenerating the upcomming obstacles.
     
  2. AppNasty

    AppNasty Miniboss Boxer

    Joined:
    Apr 14, 2016
    Messages:
    1,484
    Likes Received:
    890
    Use the Random 5 node and Spawn node. Set a Timer node between them. In a nutshell, connect Random 5 node to Start node to enable it. Then for each of the 5 links, connect a timer. This will control how fast objects will spawn. Then from timer node connect a spawn node and in it, select your enemy/object. DO this for each slot of the random 5 node and in each spawn node, choose a different object. Set different times to get a really random setup.

    Now when it triggers, the game will auto pick from 1-5 slots and spawn that object. TO get REALLY random, you can connect a Random 5 node to another random 5 node to another random 5 node to another random 5 node lololol. Or just add more slots to the main node lol.
     
    Josh (Nology Games) likes this.

Share This Page