Modular Fence / Wall Building

In this tutorial, I explain how to build a modular wall / fence building mechanic from scratch. We make use of the mouse input and implement a mechanic that let’s you create fences / walls by dragging. Poles snap to an integer grid, the user can procedually create the level connecting new walls / fences to previously created poles.

 

This is the first version of this tutorial on which I later added the option to draw perpendicular walls only: