- Home /
Is there a way get the current wind vector from a Wind Zone?
I'm working on a simple sailing game, and thought I might be able to use a Wind Zone to generate a wind pattern that changes over time in an at least somewhat realistic manner. Is there a way get the current wind speed and direction from a Wind Zone so I can use it in my own code?
Answer by OVR_Tech · Sep 05, 2018 at 08:29 PM
I'm also looking for a way to get the current wind force vector from a WindZone
component. I'm starting to think the only solution is to hack a workaround that will result in wind speed from the WindZone
component, but not force unfortunately.
(1) Create an invisible particle system that spawns one particle, has zero initial velocity and external forces enabled. This will allow the particle to move with the WindZone
component.
(2) Create a component that requires a particle system, gets the particle in LateUpdate()
, gets the difference between the current location and the last known location divided by elapsed seconds and finally sets the particle location back to the center of the particle system.
This should result in a wind speed that is late by one frame. I suppose that's better than nothing. I wish Unity would make a public Vector3 WindZone.GetCurrentWindSpeed()
or public Vector3 WindZone.GetCurrentWindForce()
whichever's more appropriate for their implementation.
Answer by viktorf87 · Nov 28, 2017 at 08:05 PM
Hi,
did you already find any solution for this? I also need the wind direction and speed for a simple sailing simulation.
Thank you four your help!,Hi,
I also need the direction and the speed of a windzone. Did you already find a solution for this?
Hi, new to Unity I'd like to know if you found a solution for wind directions and speed ? Thanks for answering. Cheers
Your answer
Follow this Question
Related Questions
question about trees 1 Answer
Swipe Wind 2 Answers
Wind zone particle system exclusion possible? [shuriken] 0 Answers
Animated clothes 1 Answer
Wind Zone for none Unity/Speedtree trees 2 Answers