- Home /
Calcuation Difference Between AddForce and AddForceAtPosition
Why isn't AddForce(force) = AddForceAtPosition(force,Vector3.zero)? Is there inputs that would make the AddForceAtPosition equal to it's AddForce counterpart?
Answer by Brian-Kehrer · Nov 18, 2009 at 05:25 AM
AddForce does not add torque, but rather assumes the force is applied to the whole object evenly.
AddForceAtPosition applies all the force at a specific point. If this point is the exact center of mass of the object, I believe the two functions should be equal. To access that use, rigidbody.centerOfMass.
Additionally, the Vector3 parameter in AddForceAtPosition is in worldspace, not local object space, so Vector3.zero would refer to the worldspace origin, not the object pivot. You should probably be using coordinates in local space of the object, for example, rigidbody.position, for the object center, or rigidbody.centerOfMass, for the center of mass.
I doubt the physics is so accurate that it is safe to assume those two functions can ever be made equal in a reliable manner.