Search Unity

I need help with a 3D endless runner game

Discussion in 'Getting Started' started by mistanobody12, Mar 20, 2018.

  1. mistanobody12

    mistanobody12

    Joined:
    Mar 20, 2018
    Posts:
    1
    I am new with unity and have made 2 2D games. I started to make a 3D endless runner game like subway surfers.
    Now the problem is i want to randomly generate different prefabs(platform on which player is running)and i cant figure out how to script it so if anyone can help me out with this please.
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Make a script with an array of prefabs as a public property (e.g. public GameObject[] prefabs). Drag all your prefabs into this array slot in the Inspector. Then in Start, or whenever you think it's appropriate to generate a platform, randomly pick from this array.
     
    DerrickMoore and Bill_Martini like this.