Marching cubes help.

Hi, I have been trying to make a terrain system that the player can terraform, and at the same time is smooth enough for vehicles to drive over.

What I have found is called marching cubes but I have not found any decent tutorials that show how to implement it in unity. Can soneone please help me or point me to some documentation / tutorials?

I implemented it using this paper: Polygonising a scalar field (Marching Cubes)
However, be aware that it’s a somewhat advanced topic, especially when you start to consider performance.

The idea is that you calculate the index of an imaginary cube, based on the scalar values in its vertices. Doing this for all values in your scalar field resembles a “cube marching through the data”, hence the name.
Visualization

This calculated cube index is then used to look up the list of corresponding edge indices, which tells you which edges you need to connect in order to create the mesh that belongs in that cube-sized space. You can then, for example, take the center points of the edges and connect all these points in the given order to create the actual triangles that make up the mesh. To create more smooth terrain, you will want to interpolate the position on the edge, based on the values of the vertices that the edge connects.