- Home /
Placing Buildings on Terrain
So I have been working on terrain generation and it's being going really great so far, except for one feature I have been working on for about a day now. I am trying to randomly place a building on the terrain, but since the terrain isn't flat I need to make it flat only around one building. So I have been randomly placing the building but I also need the terrain around it and under it to be flat. Is there a way that I can place this building and keep the ground flat around it?
I keep thing I'd get some time to explore your question, but it is not happening. There are a number of individual technical steps to solve your problem. Things such as mapping a world point to a position on the height map. @alucardj has done much of the heavy lifting on figuring this all out in his answer to this question:
http://answers.unity3d.com/questions/442581/how-to-draw-a-grid-over-parts-of-the-terrain.html
Answer by awesomeaustin316 · Aug 06, 2013 at 05:38 AM
Use the terrain tools to flatten the terrain? I don't really understand what is being asked here. What I get out of it is how to flatten the terrain, is this correct?
No, that's not it. What I'm trying to do is at runtime, place a cube in a random place on the terrain, then flatten out the piece of terrain that that cube is on, so the cube ISNT in or above the terrain
Your answer
![](https://koobas.hobune.stream/wayback/20220613111618im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Any Reason this would make Unity Freeze up? 0 Answers
Tree position on random Terrain (y axis) 0 Answers
Building generation in a voxel engine 1 Answer
When i place objects, it follows me instead of be on the terrain 0 Answers
Spawning above the terrain 2 Answers