Add collision to trees
Add collision to trees with a Capsule Collider or a SpeedTree Collision object.
Read time 1 minuteLast updated a month ago
Colliders define the shape of an object and are used to calculate physical collisions. You can add a collider to a tree asset in the Tree Editor or to a SpeedTree asset in the SpeedTree Modeler.
Set up the terrain to support tree colliders
On the Terrain tile's window, go to and make sure Enable Tree Colliders is selected.
Inspector
?
Terrain Collider
?
Add a collider to Tree Editor trees
To add a Capsule Collider to a tree asset, add it to the tree's prefab:
- In the Hierarchy window, click > next to the tree GameObject to open its prefab.
- In the prefab's Inspector window, select Add Component > Physics > to add the collider.Capsule Collider
?
- For information on how to configure the collider, refer to Capsule Collider component reference.
To return to the scene, click < next to the prefab's name.
The collider is added to the tree prefab, so you can now access it in the Inspector window of the tree GameObject. If you've already added the tree to the scene using the Paint Trees tool, the collider is added to all instances of the tree.
Add a collider to SpeedTree trees
If you created trees in the SpeedTrees Modeler with collision objects, the Unity Editor accounts for the collision objects when it calculates colliders on the terrain.
For more information, refer to the SpeedTree Collision object documentation.