Search Unity

Question What would be the best way to generate an infinite array of rooms?

Discussion in 'World Building' started by AJKindaWacky, Apr 18, 2021.

  1. AJKindaWacky

    AJKindaWacky

    Joined:
    Sep 24, 2019
    Posts:
    2
    I'm making a game that requires an infinite array a rooms to navigate in. I've tried multiple ways to do it, but none of them have worked, and I'm out of ideas. I've been using a prefab to generate the rooms. There's probably an obvious way to generate the rooms, I'm just new to this.
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    As you approach the border between rooms, instantiate a new object from the prefab. As rooms go out of view, destroy them.
     
    Kurt-Dekker likes this.