AddExplosionForce constantly like a fan

Evening guys, i was just wondering how to add an explosion force (outward force in all directions) constantly, i understand how to use addexplosionforce but only if it is triggered or hit. i have a physics based game and whenever and object moves towards it i want the force to slow it down and eventually send him in the opposite direction. any pointers? cheers :slight_smile:

Assuming that the object moves towards some point, you want a force applied in the opposite direction away from the point. Lets say we have object O and point P. Now you would create a collider around P such that when O enters that collider, the force will be applied. The direction of the force should be (O.transform.position - P.transform.position).normalize which will be a unit vector in the direction away from the point towards O.

Assuming O contains a RigidBody, the next thing to do is use the AddForce method to apply a Force to object O.


The Default ForceMode = Force should be fine.