- Home /
Question by
commodore · Sep 16, 2014 at 12:25 PM ·
terrainruntimetreesterraindata
How can I generate terrain trees at runtime?
I know you can change the terrain at runtime but is there any way to add trees?
I know trees can be deleted but I'd like to be able to add or at least reposition them while the game is running. While searching I came across terraindata.RecalculateTreePositions() but there's no mention of it in the script reference.
Comment
Best Answer
Answer by HarshadK · Sep 16, 2014 at 01:34 PM
Here's a script that randomly places trees around the position of player. You can modify that script to suit your needs.
Your answer
![](https://koobas.hobune.stream/wayback/20220613163126im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Scaling and rotaion of terrain trees 1 Answer
How do you add/remove terrain trees during gameplay? 1 Answer
Terrain trees or GameObjects? 0 Answers
Why does my tree script not work 2 Answers
Can't delete trees through script 0 Answers