Wind fake with unity physics

Hi,
searched the forum but not found anything :frowning:
has someon experimented with something like a
“fan” meaning:
I have a object in the air(rigidbody of course)
now I want that after adding force to the front and then turning on the wind - the object starts to fly in the direction.

thanks in advanced :slight_smile:

cheers

Firstly, you need to be able to access objects that could potentially be blown by the fan so you can test to see if they are in the airflow. Exactly how you do this will depend on the type of game, how often the fan comes into play, etc. For example, you might be able to keep references to all the objects in an array. You will probably need to check each object regularly to see if it is in the path of the fan. An easy way to do this is to get the object’s position in the fan’s local space using transform.InverseTransformDirection. The distance from fan to object will then be given by the Z coordinate (eg, you might want to decrease the force according to distance from the fan). You can also use the X and Y coordinate to see if the object is in the column of air surrounding the fan’s centre line. Once you have determined if an object will be blown by the fan and if so, how strongly, you can just add a force to its rigidbody.

this: http://forum.unity3d.com/threads/21104-Swipe-Gesture-Direction-Over-an-Object?p=142995&viewfull=1#post142995