Search Unity

Changing terrain wind settings during runtime

Discussion in 'Scripting' started by DP007, Apr 13, 2010.

  1. DP007

    DP007

    Joined:
    Jan 23, 2009
    Posts:
    24
    Hey,

    I'm trying to access the wind properties of the unity terrain via script to manipulate wind speed during runtime. But there is no access to these properties in the terrain or terrain data class. Is there another way to change wind settings?
    I also tried to change the bend factor for the tree prefabs but that didn't work either.
    Maybe some of you could give me some advice as I don't want to rewrite the terrain tree shaders just to access the wind settings. :)

    Thanks in advance.

    Daniel
     
  2. Ask_78

    Ask_78

    Joined:
    Jun 9, 2013
    Posts:
    4
    Wind settings solution:
    MyTerrain.terrainData.wavingGrassStrength=x; // wind speed
    note that wind speed, bend and size is swapped!
     
  3. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    481