loading...
Cover image for How to make a Bridge Building Game in Unity

How to make a Bridge Building Game in Unity

urocksgamedev profile image URocks! ・2 min read

Overview

In this two-part tutorial series, we will be creating a 2d bridge building game, where we need to build a bridge, and then our yellow characters will test if it holds them

We will be using Unity 2019.3 and Universal render pipeline (unity urp) and C#. But you can create is also in Unity 2020 or unity 2020.1 and later

Part 1

In this first part, we will start by creating world space grid material in the shader graph. Then we will create connecting points, which will be snapping to our grid also inside the editor. Then we will prepare our sprites so they can represent our bridge bars and could be extended at any length.
We will learn how to use the Dictionary collection type inside C#. Then we will create a script, which will be placing our bars on the nearest points on the grid. At the end of this first part, we will be adding maximum length option for our bars so their lengths can be limited. We will be using Unity 2019.3 and Universal render pipeline (unity urp) and C#.

Part 2

In this final second part of this series, we will be creating a 2d bridge-building game in the Unity3d game engine, where we need to create stable bridge for the lowest price possible and then our yellow characters will test it if it holds.

We will start by preparing our physics 2d joints and rigid bodies 2d to be always placed at the start and end of our bridge bars. Then we finally add the possibility to simulate our bridge for the first time with unity 2D physics. Then we will add an option for switching our construction materials where we can add also wooden bars to our bridge. Then we will be creating shader graph material with the material property block which can show the current load of our bridge per bar. Also, we will add some environment for our game and we will our yellow bridge testing characters and finally, we will add some budget option so we can challenge ourselves to build the cheapest bridge possible.

Posted on by:

Discussion

markdown guide
 

Thanks for providing an end-to-end tutorial of how to build this game.

I've always enjoyed these physics games growing up and for seeing how it can be done in Unity. I had no idea they had the hinge component to help with those joints!

I really appreciate seeing your entire workflow. It really helped me understand how UI and cross game communication can be done. It really gives me a great kicking off point of what to research next for my projects.