Here's how I do it in my physics system:
You might think this is "complicated maths", but this is not an especially easy topic.
Oh yes, and relaxd#=sqr(xdist*xdist+ydist*ydist+zdist*zdist). This should only be done once, as it's a costly calculation. You can probably substitute mass with wheight(wheight is the acceleration imaparted by mass).
deltax#=EntityX(entity2,True)-EntityX(entity1,True) deltay#=EntityY(entity2,True)-EntityY(entity1,True) deltaz#=EntityZ(entity2,True)-EntityZ(entity1,True) d#=Sqr(deltax#*deltax#+deltay#*deltay#+deltaz#*deltaz#) div#=(d#-Relaxd#)/(d#*-(mass1#+mass2#)) tmass#=mass1#+mass2# m1#=-mass1#/tmass# m2#=-mass2#/tmass# PositionEntity entity1,EntityX(entity1,True)+div#*deltax#*m1,EntityY(entity1,True)+div#*deltay#*m1,EntityZ(entity1,True)+div#*deltaz#*m1,True PositionEntity entity1,EntityX(entity1,True)-div#*deltax#*m2,EntityY(entity1,True)-div#*deltay#*m2,EntityZ(entity1,True)-div#*deltaz#*m2,True
You might think this is "complicated maths", but this is not an especially easy topic.
Oh yes, and relaxd#=sqr(xdist*xdist+ydist*ydist+zdist*zdist). This should only be done once, as it's a costly calculation. You can probably substitute mass with wheight(wheight is the acceleration imaparted by mass).