We went through some difficult coding recently. You might feel a bit uncomfortable still, but don't worry. The more time you spend coding, the more confidence you gain.
To test whether everything works correctly, we need to do some setup in the Scene:
GameObject
and call it LevelGenerator
.LevelGenerator
Component to the LevelGenerator
game object.startPoint
:Player
game object. Thus, the first generated level piece will appear directly under the Player
.LevelPieceBasic
game object as the first element on the LevelPrefabs
array.startPoint
game object into the correct slot in the LevelGenerator
component:Congratulations! You just wrote a working part of a procedurally generated level. I get its not most exciting level yet. We will slowly get there; don't worry! Press S on the keyboard to start the game.