- Home /
How do I make trees sway in the wind?
I just finished making a couple trees in the tree creator tool in Unity.
I added a wind zone and the leaves are shaking. Good!
But, for some reason, the entire tree trunk is completely solid. This is a palm tree. I want to see the entire thing bend in the wind.
How would I get it to do that without a terrain in the scene?
Answer by fafase · Apr 05, 2012 at 06:03 AM
You might have to go back to the inner parts of the creation of the tree, http://unity3d.com/support/documentation/Components/tree-Branches.html.
See the animation part at the bottom and you might find what you need.
That looks like a good idea. I'll just make the wind really strong, and turn down the animation settings for everything besides the main branch.
Yep.. it worked. The wind comes at a pretty low setting by default, so you just increase the wind and decrease the animation settings on all parts of the tree except the main branch which can be adjusted to sway more than the rest of the branches.
Answer by fafase · Apr 04, 2012 at 05:51 AM
In the inspector of the terrain, if you click add tree, a little drop down box shows up. Choose edit tree. A window opens with the name of the prefab and bend factor.
Give it a value. Consider this action quite expensive so avoid large number. Start with 2 and see the effect on your game and if it looks ok.
But as I was saying previously, my scene doesn't have a terrain. It's all a city.. so.. do I have to create an empty terrain object for this to work? Wouldn't that add more overhead to my project? This is dealing with the tree painter.. so would it be able to paint trees on a mesh collier? I mean.. what does this effect have to do with the terrain object?