- Can part B only move along an axis? 2 axes? Can it rotate?
- Is part B rigid?
- Is the force from part A only along an axis?
- Use a Transform Sensor to measure the distance between the CG of part A and part B along the axis of movement
- If that distance is less than (length of A - length of B)/2, force is maximum
- If that distance is more than (length of A + length of B)/2, force is zero
- Else, ramp the force from (0 - maximum) based on the separation.