Random Level Generation

Hi all,
I am currently trying to make a Race The Sun style of game for a University project, and I have no idea how to tackle the world generation. My question is how would I go about having a corridor randomly generate obstacles along a path as manually placing each obstacle would be near impossible for a track of near endless length. The obstacles will range in the x, y, and z sizes.

Any help would be appreciated.

Many thanks in advance! :slight_smile:

I’m not familiar with the game but a cursory glance at some screenshots make it look like they’re just random obstacles placed in front of the player. Is that correct?

Track the player’s position and spawn objects Z amount of units ahead and at a random +/- X relative to the player’s position (something like Random.Range(player.x - 100, player.x + 100)). When the obstacle is behind the player, position it ahead of them again.

If you want something more consistent, you could also create a bunch of prefabs and choose one at random to place in front of the player. This way you have more granular control of say, placing powerups and collectibles in harder to reach spots.

Thanks for the reply, and yes I would say that they are placed randomly in front of the player.
I will give what you suggested a shot as it seems like a very large step in the right direction.

Thanks :slight_smile: