- Home /
Generate heightmap from Terrain object with code
I want to make a 2D simulation of objects growing on a heightmap and then generate 3D objects from the simulation to the Terrain object which the heightmap is generated from. I know how to do this for a fixed Terrain but I want the Terrain to be arbitrary. Which means that I would need to generate a heightmap when the user has specified which Terrain that should be used. Is there any way to generate a heightmap on runtime with code?
Answer by tanoshimi · Nov 18, 2016 at 10:02 PM
Sounds like you're looking for Terrain.GetHeights.
No, what I want is to generate the image of the heightmap to use as background for the simulation.
You want to have an image (such as a Sprite, Texture, etc) that displays pixels that are black, white or shades of grey based on the corresponding height of the terrain at all points - is that correct?
Your answer
Follow this Question
Related Questions
Terrain and character navigation 0 Answers
Importing non-traditional 512x512,1024 x1024 Height Maps 0 Answers
Why do Unity 5 is glitched as hell? Please, I need help... 0 Answers
Third Person Controller Movement on Elevated Terrain 1 Answer
Issue with importing raw heightmaps (made in photoshop) 5 Answers