Design a tree in the Tree Editor, create its materials, and add collidersAn invisible shape that is used to handle physical collisions for an object. A collider doesn’t need to be exactly the same shape as the object’s mesh - a rough approximation is often more efficient and indistinguishable in gameplay. More info
See in Glossary.
If you want to use an imported meshThe main graphics primitive of Unity. Meshes make up a large part of your 3D worlds. Unity supports triangulated or Quadrangulated polygon meshes. Nurbs, Nurms, Subdiv surfaces must be converted to polygons. More info
See in Glossary, refer to Create trees and leaves from meshes.
To create a new Tree asset, from the main menu, select GameObject > 3D Object > Tree.
This action adds a tree to your SceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary view. It also adds a tree prefabAn asset type that allows you to store a GameObject complete with components and properties. The prefab acts as a template from which you can create new object instances in the scene. More info
See in Glossary (Tree.prefab
) and a texture folder (Tree_Textures
) in the Assets
folder of your Project window.
Trees can render correctly only when placed in a folder called Ambient-Occlusion
.
Assets
folder.Ambient-Occlusion
.Ambient-Occlusion
folder.The first branch functions as the trunk - it starts on the ground and grows upwards. This example creates a single trunk, but you can create multiple trunks, for example for a group of reeds (refer to the Frequency property in the Branch group reference).
Select the tree to view it in the Inspector window. The Tree Hierarchy view shows the root node and the branch group that functions as the trunk. To learn more, refer to Tree Editor concepts.
Use the Tree Hierarchy view controls to manage branch and leaf groups:
Branches are managed in groups. To add branches to the tree trunk, in the Tree Hierarchy view, select the existing branch group (the trunk) and click Add Branch Group.
A new branch group has only one branch. To add more branches, in the Inspector window > Tree Hierarchy view, select the new branch group and change its Frequency setting.
To add smaller branches to the existing branches, select the branch group you just added (not the trunk) and click Add Branch Group. The new branch group is added at a level above the selected branch group. Change the new group’s frequency to add more branches.
Note: The frequency isn’t always the final number of branches. The number of branches in the first group does equal its frequency, because those branches all grow out of a single branch (the trunk). In this new group, however, the branches grow from all the branches in the previous group, and so their frequency is distributed. To create a natural look, the growth isn’t uniform, meaning the distribution isn’t even. As a result, the final number of branches in the second group isn’t a simple product of the two frequencies.
A new branch group’s growth angle is parallel to the ground. To change the angle, select the branch group and adjust its Growth Angle setting. You can also change its Seek Sun setting to make the branches bend upwards or downwards.
For more branch group settings and to learn about fronds, refer to Branch group reference.
You can add leaves to any branch group, including the trunk. You can also add leaves to the tree root node, which gives the effect of leaves scattered on the ground. Like branches, leaves are managed in groups.
To add leaves to a branch group, select the branch group and click Add Leaf Group.
Leaves are added as an opaque plane. Change the group settings until you like the leaves’ appearance before adding materials. For more information, refer to Leaf group reference.
You can use the leaf group to add fruit. Refer to Create trees and leaves from meshes for more information.
To create fruit and leaves that overlap, add two leaf groups at the same level, and give them the same frequency and distribution.
Trees have four materials: for the leaves, the fronds, the bark, and the cross-section visible on broken branches.
To create a material:
From the main menu, select Assets > Create > Material.
Name the material.
Tree Editor trees and leaves must use these shaders. You can’t use your own shaders.
Add textures. If you don’t have textures yet, you can rely on the Main color selection for testing, or download assets from the Unity Asset Store.
To learn more about textures, refer to TexturesAn image used when rendering a GameObject, Sprite, or UI element. Textures are often applied to the surface of a mesh to give it visual detail. More info
See in Glossary.
To add a material to a group, select the group in the Tree Hierarchy view and assign the material in its Geometry section:
GameObject transforms work only on the tree as a whole and are available when you select the tree root node.
To transform individual branches and leaves, use the tree creator’s control points.
Tip: To transform the entire tree, click the Tree Root Node button.
When you select a branch group in the Tree Hierarchy view, the Unity Editor selects its branches in the Scene viewAn interactive view into the world you are creating. You use the Scene View to select and position scenery, characters, cameras, lights, and all other types of Game Object. More info
See in Glossary. The branch or leaf group in the Scene view includes control points, which you can use to edit the branch or leaf. The following example shows a tree with a single branch selected.
The control options are available from a toolbarA row of buttons and basic controls at the top of the Unity Editor that allows you to interact with the Editor in various ways (e.g. scaling, translation). More info
See in Glossary below the Tree Hierarchy view.
The control points of the branches pass through the center line of each branch. You can click and drag any of the control points to move the branch.
For a branch, the control options are:
For leaves, the control options are:
Some branch and leaf properties are procedural, meaning that the Tree Editor generates them. When you edit a branch or leaf, the Tree Editor disables the procedural properties.
To restore the procedural properties, click Convert to Procedural Group. This removes any edits you made by hand.
Colliders define the shape of an object. They calculate physical collisionsA collision occurs when the physics engine detects that the colliders of two GameObjects make contact or overlap, when at least one has a Rigidbody component and is in motion. More info
See in Glossary so that a character can’t walk through a tree, for example. Trees use the Capsule ColliderA capsule-shaped collider component that handles collisions for GameObjects like barrels and character limbs. More info
See in Glossary component.
To learn more about tree colliders, refer to Add collision to trees.
Wind Zones animate tree movements.
To add a Wind ZoneA GameObject that adds the effect of wind to your terrain. For instance, Trees within a wind zone will bend in a realistic animated fashion and the wind itself will move in pulses to create natural patterns of movement among the tree. More info
See in Glossary GameObjectThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
See in Glossary, in the tree’s Inspector window, click Create Wind Zone. You can do this from any branch or leaf group, but not from the tree root node.
The Wind Zone’s default settings create a gentle breeze, and you can use it for your trees without changing it. If you want to create a stronger wind effect, refer to Animate trees with Wind Zones.
The tree is now ready to be painted onto the terrainThe landscape in your scene. A Terrain GameObject adds a large flat plane to your scene and you can use the Terrain’s Inspector window to create a detailed landscape. More info
See in Glossary in groups. It’s a good idea to make the tree GameObject invisible so that you don’t accidentally move it or change its settings.
Select the tree GameObject in the Hierarchy window, and in the Inspector window, disable the Visibility checkbox next to the GameObject’s name.
Use the Paint Trees tool to add clumps of your tree to the terrain. Refer to Add trees to the terrain for more information.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.
When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
More information
These cookies enable the website to provide enhanced functionality and personalisation. They may be set by us or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.
These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising. Some 3rd party video providers do not allow video views without targeting cookies. If you are experiencing difficulty viewing a video, you will need to set your cookie preferences for targeting to yes if you wish to view videos from these providers. Unity does not control this.
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.