Mass place trees on terrain based on polygon/point data

Is there a way to mass place trees on the terrain based on points or polygons?

I have a pretty big scene for a town and got some data on where the trees are placed in real life. This can be exported as either points or polygons.

If the polygons are aligned on top of the terrain in Unity - is there an easy way to mass place a specific prefab of a tree based on the individual polygons/points on the terrain?

On the image below each red dot is a tree and this is just a fraction of the entire city. I would hate to place each tree manually with Terrain Paint Tree function…

Steps to success:

  • Look into Unity editor scripting

  • Write an editor script to accept the list of points and create trees on your terrain

  • Dirty the scene and save it.

The heaviest lift will likely be:

  • figuring out how to produce trees in the terrain (read the docs)

  • figuring out coordinate transforms to operate against the terrain from whatever coordinates the source data is using

You could always instead just create GameObjects at those positions rather than actual terrain trees.

Hi Kurt-Dekker

Thanks for getting back to me. Sounds like an almost impossible task for at none programmer like me :slight_smile: I was more looking for a plugin that could help me with the task. I don’t mind paying a bit of money for something that could potential save me a lot of hours of manual work.

I’ve been looking at the documentation for Vegetation Studio Pro and it looks like it has an option that can bake a splatmap for treeplacement based on geometri. So this could be a solution for me for now

https://assetstore.unity.com/packages/tools/terrain/vegetation-studio-pro-131835

there is a free tool to massreplace gameobjects. so when the markers are gameobjects you can replace them with trees.

1 Like

Thanks - I will check this out. Looks like just the thing I need :slight_smile: