Does anyone know how to disable a wind zone through script? I have tried every enable/disable command and nothing works, unless there’s a way to that I’m not aware of.
Please if anyone knows how it’d be great, since Unity doesn’t allow us access the Wind Zone commands. I was just about to release a video of our new system and now I’m stuck with this problem.
The WindZone DataType is private in Unity as of 3.x - this is still true as of 4.5.x
This means you cannot access its properties using strict typing (#pragma strict) and typeof(). So if you try GetComponent(WindZone) or GetComponent(typeof(WindZone)) you will receive an unknown type error message from Unity Console.
All you have to do is switch to dynamic typing, it is this easy:
Remove #pragma strict from the top of your script.
Change any usage instance of GetComponent(WindZone) or GetComponent(typeof(WindZone)) to GetComponent(“WindZone”); (Include speech marks!) and remove any var type declartions.
So instead of:
#pragma strict
var wz:WindZone = GetComponent(WindZone);
Your script should look like:
//#pragma strict
var wz = GetComponent("WindZone");
Now the unknown type error in Unity console will be gone and your script has access to WindZone script properties through the var called “wz” you can now do: