[OPEN-SOURCE] Machinery Modelling Toolkit

AddForceAt location is what you need and force vector should be in the world space. So it goes like this:

  1. This will be recoil vector in local space coordinates (-500000, 0, 0) meaning we want to push turret backwards by 500 000 N cm
  2. GetWorldTransform of your barrel or a turret. And do TransformDirection on Recoil vector using WorldTransform of the turret or a barrel
  3. Apply transformed recoil vector using AddForceAtLocation, provide world space coordinates of the barrel/turret to as a point where recoil should be applied