Dynamically generating 3D meshes in Unity: what not to do

A simple 2D square generated in Unity. It's purple because we haven't assigned any shaders yet.
A simple 2D square generated in Unity. It’s purple because we haven’t assigned any shaders yet.

Recently in Unity, I’ve been playing with dynamic map generation. I wanted a hex-based map, so first things being first, I needed a hexagon. My hexagons would be pretty simple meshes, and I had to have all the points and calculations¬†about their shape encoded into Unity anyway, since I would need that to put together the grid, so I decided to dynamically generate the mesh itself through Unity. Continue reading