Wind force.

Hello everyone;

In my have I have a drone and I want the movement of this drone to be affected sometimes by a wind force. Is there a way to do this?


Yes. You will need to have some kind of wind vector somwhere (game instance, drone actor, a seperate wind actor in your level, …) And then read the wind vector from within your drone every tick or with a delay. Then you apply the wind vector as a force to your drone.

Can you give more explanation about creating the wind actor.

Thank you for your response.

Ok. So first create an actor. Call it “WindForce” for example. Inside the actor make a new variable of type “vector”. Now in tick or however you want you should change the direction and force. Like so:

NOTE: change 2 to -10. Otherwise it will keep accumulating in positive force and will end up being insanely fast. This is a bad randomisation approach as it can still create very fast winds. You should come up with something better. But it’s just for the sake of making it work.

NOTE2: You can also normalize the resulting vector. That will create a force vector that will not go over 1 and under 0.

Place the windforce actor inside your level.

Then in your drone actor. Go to beginplay. Connect “Get all actors of class”, as class select “windforce”. Then drag out wire and type “get”. Leave “0” as get input. Out of get drag wire and type “windvector”. Promote to variable.

Then go to tick of your drone actor and apply the promoted variable as a force.

Should work. Haven’t tested it myself, but I think it should work.

Dear ,

The explanation is very clear I will try it.

Thank you very much.