- Home /
CreateTerrainGameObject not creating tree colliders?
I'm passing terrain data from the server to the client. On client side, I recreate the TerrainData and call CreateTerrainGameObject. Works fine, trees are all there, etc. Except for one VERY important thing...no tree colliders.
The exact same terrain on my server works fine, but it holds the original. I'm only using one tree prefab, it has a collider, as does my player.
I've tried TerrainData.RefreshPrototypes, and Terrain.Flush(). No luck. Anyone else run into this?
I currently have the same problem, I found that when creating a terrain manually you have to check the "Create tree colliders" thingy in the terrain collider settings (http://unity3d.com/support/documentation/Components/terrain-Trees.html), though can't find how to do this in code, you found it yet?
Answer by jc_lvngstn · Jun 14, 2012 at 04:30 PM
I've only been able to consistently get the terrain to recreate all colliders by doing these three things:
Reassign the trees
Force a heightmap refresh by calling SetHeights. You can just supply an empty value at 0,0.
Disable and reenable the terrain collider.
I'll add some code when I get the chance.
Your answer
Follow this Question
Related Questions
Removing terrain tree at runtime not updating collider 1 Answer
Remove trees dynamically - stuck with collider 3 Answers
Picking Trees with Mouse 5 Answers
Billboard system 1 Answer