Craters in Unity Terrain

In the 18/19th century cannoneers often increased the range and/or damage of ball rounds by letting them go ricochet. Also, explosive rounds created some small craters, too.

For my project I’d like to recreate this effect visually. What would be the best approach? Currently, I’m planning to instantiate some prefabs based on the angle and velocity (stretched crater from ricochets, round craters for explosive rounds) and simply but them on the terrain plus a few particles.

Is this a recommented method? Or could I manipulate the terrain in this case? Would it be more efficient? Or are there better methods I and others haven’t thought about as I haven’t foun any helpful advice for this topic.

Afaik the Terrain has an accessable Heighmap. How can I e.g lowe this at the hit Point of my projectile?

terrain.setheights is very dumb, I tried and I couldn’t get it to work how I liked. Its really hard to set heights exactly due to how it works. So, I’m making my own terrain system from scratch.

That’s great, now why did you post it here

I’m not sure about getting that at runtime, but if you can, you could just simply set some pixels in a circle pattern with local coordinates (so hitpoint - terrainpos)

Because, I’m trying to tell him its really hard. Maybe he could use the system I’m trying to make.

It’s not that hard. Terrain.SetHeights is fine unless you need exact detail, and yes it works at runtime. Presumably you’d also set alphamaps for scorch marks. Here’s an example of a little experiment I did years ago (though it uses a projector for scorch marks instead of manipulating alphamaps).

–Eric

Agreed with the Terrain.SetHeights. Check out [this thread ](http:// Modifying terrain height under a gameobject at runtime - Questions & Answers - Unity Discussions)maybe?

An alternative, possibly easier/safer route might be to spawn crater mesh on top of the terrain where the canon ball strikes. Crater’s usually push up the dirt around them anyway, so a bowl-shaped mound could look alright. Plus, prevents player from totally destroying your terrain, and you can object pool the craters meshes, removing the old ones after some time.

The link doesnt contain anything. Would be interesting to see

Looks good but I need mre details in this case

Whoops, sorry. I believe this was the one Modifying terrain height under a gameobject at runtime - Questions & Answers - Unity Discussions