Learning C# By Developing Games with Unity 5.x

 

 


Looking Back…

While the book isn’t one of my favourites I’ve read, it did introduce me to working with procedural generation in Unity. I’ve done some in Gamemaker, but this was my first time working with the concept in a new engine. The book project works with an endless runner, creating a prefab of a piece of land. When the player runs to the right they step through a trigger collider that deletes the old instance and creates a new one selected from several prefabs. My biggest struggle and gripe with the book was a lack of emphasis on prefabs vs instances. I ended up using instances and thus got null references. My hack was to simply not delete the old piece of land as it could then be used to copy over onto a new instance that the player runs onto. Obviously now that I’m more experienced I can see where I made those mistakes; however, as a complete beginner I was utterly lost and confused as to why I got such errors, and as stated the book did not clearly emphasise those concepts enough.