# Create wind zone script (without using a WindZone object)

**URL:** https://discussions.unity.com/t/create-wind-zone-script-without-using-a-windzone-object/657263
**Category:** Scripting
**Tags:** Scripting
**Created:** [March 4, 2017, 3:05pm UTC](https://discussions.unity.com/t/create-wind-zone-script-without-using-a-windzone-object/657263 "2017-03-04T15:05:49Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Karl\_iyo](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/karl_iyo/32/303415_2.png) [@Karl\_iyo](https://discussions.unity.com/u/Karl_iyo)
#### Post date: [March 4, 2017, 3:05pm UTC](https://discussions.unity.com/t/create-wind-zone-script-without-using-a-windzone-object/657263/1 "2017-03-04T15:05:49Z")

</div>

Hello everybody,

The thing is, I want to create something like a wind zone to move trees, but I want to use this wind to move other things (whose parameters change using physics by script). I have tried with a normal windzone object, but I cannot get the wind force (there is no such a thing as a vector3 or vectorXD or whatever), so I can’t use it. If I could get the force from the windzone object (in a vector), I could add this force in my physics engine.

Any ideas??

Many thanks!

---

<div class="post-metadata">

### Author: ![BTCallahan](https://avatars.discourse-cdn.com/v4/letter/b/51bf81/32.png) [@BTCallahan](https://discussions.unity.com/u/BTCallahan)
#### Post date: [March 4, 2017, 6:45pm UTC](https://discussions.unity.com/t/create-wind-zone-script-without-using-a-windzone-object/657263/2 "2017-03-04T18:45:58Z")

</div>

Try something like windzone.transform.foward, or if that doesn’t give you what you’re looking for, try windzone.transform.rotation.eulerAngles.

---

<div class="post-metadata">

### Author: ![Karl\_iyo](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/karl_iyo/32/303415_2.png) [@Karl\_iyo](https://discussions.unity.com/u/Karl_iyo)
#### Post date: [March 4, 2017, 9:08pm UTC](https://discussions.unity.com/t/create-wind-zone-script-without-using-a-windzone-object/657263/3 "2017-03-04T21:08:49Z")

</div>

None of them work…the wind changes but the value in the transforms remains the same…

---

<div class="post-metadata">

### Author: ![mgear](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/mgear/32/886412_2.png) [@mgear](https://discussions.unity.com/u/mgear)
#### Post date: [March 5, 2017, 6:24am UTC](https://discussions.unity.com/t/create-wind-zone-script-without-using-a-windzone-object/657263/4 "2017-03-05T06:24:56Z")

</div>

google offers these solutions,

using particles

> **[Wind that affects rigidbodies and particles](https://discussions.unity.com/threads/wind-that-affects-rigidbodies-and-particles.330944/)**
>
> Hi all, I want to make a wind effect that affects a selection of rigidbodies (e.g. making hanging lights sway) and also particle effects. From what I’ve seen the built-in Wind Zones are mainly targeted at terrain and can be made to work with...

using c# reflection

> **[Access Terrain Wind Setting and Wind Zone in Unity3D 3.0.02f](https://discussions.unity.com/threads/access-terrain-wind-setting-and-wind-zone-in-unity3d-3-0-02f.60593/)**
>
> I am trying to access terrain wind settings for bending factors in realtime, however it's not avalible. Same goes for the wind turblence script that's in Unity 3.0, I don't see a way to access that script either. How Can I get any access to...

---

<div class="post-metadata">

### Author: ![Hikiko66](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/hikiko66/32/270859_2.png) [@Hikiko66](https://discussions.unity.com/u/Hikiko66)
#### Post date: [March 5, 2017, 12:23pm UTC](https://discussions.unity.com/t/create-wind-zone-script-without-using-a-windzone-object/657263/5 "2017-03-05T12:23:27Z")

</div>

Yeah. Reflection is the way I do it.

Note that the windzone affects trees and particles.  
Terrain grass, on the other hand, is actually controlled using the terrain settings

---

<div class="post-metadata">

### Author: ![methusalah999](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/methusalah999/32/552523_2.png) [@methusalah999](https://discussions.unity.com/u/methusalah999)
#### Post date: [November 17, 2019, 10:16pm UTC](https://discussions.unity.com/t/create-wind-zone-script-without-using-a-windzone-object/657263/6 "2019-11-17T22:16:50Z")

</div>

This is a shame. It would be so simple to make the current wind public in WindZone.

---

<div class="post-metadata">

### Author: ![Hikiko66](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/hikiko66/32/270859_2.png) [@Hikiko66](https://discussions.unity.com/u/Hikiko66)
#### Post date: [November 18, 2019, 12:17am UTC](https://discussions.unity.com/t/create-wind-zone-script-without-using-a-windzone-object/657263/7 "2019-11-18T00:17:07Z")

</div>

> [@methusalah999](#):
>
> This is a shame. It would be so simple to make the current wind public in WindZone.

They have made it public. No reflection required anymore.

---

<div class="post-metadata">

### Author: ![methusalah999](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/methusalah999/32/552523_2.png) [@methusalah999](https://discussions.unity.com/u/methusalah999)
#### Post date: [November 18, 2019, 1:15am UTC](https://discussions.unity.com/t/create-wind-zone-script-without-using-a-windzone-object/657263/8 "2019-11-18T01:15:02Z")

</div>

> [@Hikiko66](#):
>
> They have made it public. No reflection required anymore.

We are indeed able to control the script by code now, but I was talking about the current wind itself. I still can’t see any way of getting the wind force at some position, without ugly tricks.
