- Home /
Destructible ground?
Hey! So, i'm pretty new to Unity, (I've never made anything too serious with it) and i'm wondering how i can create a destructible ground, that can be mined out using various tools? I assume i can't use the default terrain system of Unity, since that creates flat terrain, and if i raise the ground it is going to be hollow on the inside. I'll probably make a 3D model, that is the form of my terrain and is deep. Anyway, how can i create holes into that model/prefab, so you can technically mine down?
Sorry if this question has been asked before, but couldn't find any answers...
If you're new you should focus on things that you can actually do, which in this case is not terrain editing like destructible terrain. I did this back when I was new, but seriously, make small things for now and then you'll get to the point where you can make something a bit bigger and then eventually you'll reach the point where you can do this.
Best of luck finding your answer, although it is probably a complex solution.
Answer by whisp · Jan 11, 2016 at 06:45 PM
The Unity terrain engine is indeed not suited for "mining", since it's purely heightmap-based and thus doesn't support overlapping terrainparts.
However, the 3d model doesn't need to be deep, it just needs to be suggestive of beeing deep, while you would extend it by a hole in a specific direction when the player uses his shovel on it. A very difficult task if you want to do this with a common mesh model, e.g. with boolean operations on polygons. But this is not only difficult for the developer, but also for the CPU and thus not really a recommendation.
But you could do something like minecraft: Just start arranging blocks next to each other (e.g. create an editor or generate them procedurally, e.g. with perlin noise) and start optimizing (e.g. removing unseen blocks, merge blocks and so on) when you note problems in performance. That's a good way to learn more about Unity and 3d Graphics.
Or you just use an existing asset, such as Voxeland from the Unity Asset Store.
Answer by TySim · Jan 13, 2016 at 06:55 PM
Suggestion you can try...
Create a flat plane. Create a set of "blocks" to go on the plane that is terrain. The first 3 or 4 blocks would look like a dug hole so to speak and the top box would be the actual terrain block. When someone digs, the top block gets destroyed and the underlying block (that looks like a hole) is visible. That block can actually have concave curve on the top to give it more realism, instead of just a cube.
This is resource intense though, so optimizing it is a must.
The thing is i'm not going for block based... I'm asking if there's a way to blow holes into a mesh.
Check this link out It tells you how to modify a mesh at runtime...
Your answer
Follow this Question
Related Questions
Terrain painting in grid? 0 Answers
generating a 3D terrain from a 2D tiled map 2 Answers
My characters can't sto falling terrain 1 Answer
Destructable objs and terrian 0 Answers