Terrain Craters

I’m looking to have my maps fully destructible, so one thing I’m looking at doing is having the map’s terrain mesh be able to have craters made in it when appropriate conditions apply.

From what I’ve seen online, the approach would involve creating a sphere halfway through the terrain, and then conform the vertices that are within the sphere to take shape around it – making a bowl-like shape within the terrain.

I know I am supposed to give my first attempt at making this script, but I seriously have no idea where to start. It sounds relatively easy, but one of the problems afterward would be resetting the mesh collider so that it compensates the crater(s), and then from there it’s just creating a projector over the crater to project the new destructed ground texture.

If anybody can give me a place to start, or explain to me everything script-wise I would have to implement, it would be greatly appreciated!

Maybe these links will help you on the way:

Modifying terrain height under a gameobject at runtime

Modifying Terrain Splat Texture at Runtime

If you’re talking about the built-in Unity terrain, there is no mesh that you have access to, it’s a heightmap. See TerrainData.GetHeights/SetHeights.