Procedural Generation Basics: Position Variation [Unity3D C# Tutorial]

Uploaded by Matt MirrorFish
Share: Twitter Facebook
In this unity tutorial we will learn how to randomize the positions in a spawned grid in C#. The idea here is instead of randomly scattering objects we are spawning in a grid first, then adding random position variation to make the spawning structured but more irregular.

We are showing a 3D grid example made out of cubes but the same code will also work for spawning a 2D grid. This tutorial is created in Unity 2019 but will also work in older versions of Unity. These type of techniques can be useful when instantiating prefabs in unity3d, and also in roguelike games.

Download the example here: http://bit.ly/pcgbasicsrepo