Hello,
I am working on a scene with trees and grass, and I have implemented a background script that sends data to Unity specifying the direction of the wind. I would like to make the trees sway in the specified direction (Left or Right). Currently, I have checked the Wind Settings for Grass in the Terrain Settings and the Wind Mode, Wind Turbulence, etc in WindZone, but both of these settings are causing the trees to sway randomly, rather than in the direction I’m specifying.
Is there a way to set the direction of the wind and change it at runtime? I would appreciate any guidance on this matter.
Hi,
If your trees are “listening” to the WindZone, they should bend in the direction the WindZone gizmo is pointing (e.g., WindZone rotation in y). You can add a bit of sway via the Pulse parameters.
GameObject->3D Object->Tree will do this (in BiRP, I’m not sure if this stuff still works in SRP). I just tested this in a clean scene with a new tree & WindZone, if I set WindZone.main to 5 & spin the WindZone, the tree bends in the direction the WindZone gizmo is pointing.
Turbulence is a bit confusing as it adds a bit of random wobble to child-branches, so these branches first bend in the direction of the wind, but then wobble forwards and backward.
As far as I know, only trees that “know about” WindZone will react properly. Like if I make a tree mesh in ProBuilder or whatever and plop it down, it’ll just sit there.
A little OT: I don’t know if you’re using GPUInstancer or something similar, I think that does its own thing with wind, I think you can hook your WindZone up to GPUI to make it pay attention properly, but it’s not the default behaviour for dynamic WindZone. Ah, similarly, we’re using Enviro 3 in our game, which also kindof does its own thing. Various of the 3rd-party assets in our game kindof partially pay attention to WindZone, do their own thing, or ignore entirely.
WindZone feels a little half-baked tbh (or maybe, I just want more from it that it’s intended to give:)), I really want to use it but it’s been awkward so far in our game.