How would I create an arbitrary mesh during runtime, copying the shape of the terrain underneath?
I'm currently playing around with a city building game, and I want the player to be able to make farms, by dropping x amount of points to create a polygon, confirm the shape, and build a farming field in that shape.
The terrain can go up and down, so I would prefer for the farm to "fall down" on the terrain, instead of it being a plane. It should also check if it's building in a legal spot (i.e. no houses, preferably no steep drops, e.t.c.) I do use nav meshes for navigation - and I think the walkable parts of the nav mesh should be pretty good for determining legal placement.
Additionally, I would like the player to be able to select the farm again, and change some options, and preferably also the shape.
Finally, I want to be able to revert the farm land back to normal grass.
An idea I have at the moment is basically just to make a custom mesh, "copying" the underlying terrain - but I don't know of or how that's possible. If not, how would I approach this?
Your answer
Follow this Question
Related Questions
Generating Mesh using Points 1 Answer
Best way to cycle through different generation settings? 0 Answers
Light lines between meshes 2 Answers
Ideas on Cloning A Game 0 Answers
I need help in "stretching an object like rubber" in Unity3D 0 Answers