Substitute for "Force Fields" In the game engine.

I need something to make a force field type effect on a rigid body object in the game engine. I want to create some wind, exploding, and even in the future vortex type effects, but unfortunately since regular force fields don’t yet transfer over to the game engine like I would need them to.

I have looked for this kind of question, but have failed to come to a proper answer.
Any help greatly appreciated.

Fairly easy with python. just use dynamicObject.applyForce(Vector) with dynamicObject being the object you want to influence. Vortex might be a bit more difficult calculating the vector since its rotating.

edit: Note that the vector gives you the direction as well as the strength of the force

getVelocity

and setLinearVelocity

X = obj.getVelocity
X.x=X.x+(wind)
obj.SetLinearVelocity=X

*for vortex

attach a object to the object with 6dof and then have it slowly dRot and apply impulse :slight_smile:

That wouldn’t quite work, as the API calls are obj.getVelocity() and obj.setLinearVelocity(), not obj.setLinearVelocity = value. Capt could use obj.localLinearVelocity = [x, y, z], and rotate the objects in the vortex to face the center point.

Thank you :slight_smile: I frequently fix stuff as it errors, so I am usually slightly off but in the ballpark

Mine was for wind :slight_smile:

velocity.x=velocity.x+wind is the important bit

I don’t really know how to express it until I dig a little