- Home /
Wind that affects game objects
Hello,
How can I create a wind zone, where the wind is affecting the player, and the wind is stronger at the point of origin?
I would like it to be something like this:
Answer by Waz · Aug 07, 2011 at 09:56 AM
Wind is just a force. You'll need to perturb (wobble) it a bit, perhaps using a Perlin noise function. To have the strength be different at different locations, factor the distance into the calculation.
Have your wind zone script scan the scene for targets (eg. using Physics.OverlapSphere), then each FixedUpdate, apply a force (AddForce or even an AddForceAtPosition randomly slightly offset from the centerOfMass).
Hopefully there are enough keywords above that you can assemble this yourself. Alternatively there may be a pre-canned script with enough parameters.
As an artistic tip, I'd recommend some visual feedback too. For example, have some snow or dust that is similarly affected, so the player gets a visual cue.
On the audio side, adjust the pitch of a basic wind loop (eg. this one I made), higher pitch for faster wind (especially if the wind varies in speed, but even if it doesn't).
Answer by Tomas smith · Apr 06, 2014 at 09:14 AM
That tool might help you! It is really good for wind simulations.
Your answer
Follow this Question
Related Questions
How to Buffet an object floating in space? 1 Answer
How to add wind in 2D physics game 2 Answers
Physics on a Robe (Kind of like the "Journey" character) 0 Answers
How to make building affected by wind? 0 Answers
Swipe Wind 2 Answers