Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How to do tree of flower blowing in the wind?

Discussion in 'Physics' started by yoonitee, May 9, 2016.

  1. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,363
    I guess one way is to rig a model of a tree and animate it manually.
    How would one do this procedurally?
    Basically to give each bone in model a bit of give or springiness?

    Is there a way to procedurally do this in Blender or Unity3D so the trees/flowers could respond to a wind force?
     
  2. Josenifftodd

    Josenifftodd

    Joined:
    Nov 29, 2013
    Posts:
    158
    Providing the mesh on the flower model is fine, you could use the cloth component which response to the windzone.
    as for procedurally generating them the flowers. If your terrains max height is 10 and lowest is -10 then you'd call your vertices and instantiate it on vertices[v].y then you could do
    Code (CSharp):
    1. if (vertices[v].y >= 6) {
    2. // instantiate your model here but remember to grab the vertices position using flowerPos
    3. }