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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

2D Level Generation

Discussion in 'Scripting' started by Xavior87, Apr 11, 2015.

  1. Xavior87

    Xavior87

    Joined:
    Feb 22, 2015
    Posts:
    23
    How would I make a randomly generated 2D level that would have objects inside of it (Chests, enemies, trees)?
    Sort of like this:

    Any help is most appreciated! :)
     
  2. Juice-Tin

    Juice-Tin

    Joined:
    Jul 22, 2012
    Posts:
    233
    But an easy way to do level generation would be to create many small sections of levels using prefabs.
    Then when the game starts, you can have the prefabs randomly placed next to each other (making sure the platforms line up) which will result in a randomly generated level. :)

    Also I found this through a quick google search, might be worth looking at:
     
  3. Xavior87

    Xavior87

    Joined:
    Feb 22, 2015
    Posts:
    23
    Thanks!