c# - 2D distance constraint -
i've been trying 2d distance joint working in unity. want free rotation both body joint , connected body, need mass , other constraints adhered to, such fixing rigidbody's position. i've tryed days now, no luck configuring joint type. tryed verlet constraint using: float xdistance = hinge.transform.position.x - target.transform.position.x; float ydistance = hinge.transform.position.y - target.transform.position.y; float newdistance = mathf.sqrt( xdistance * xdistance + ydistance * ydistance ); float con = ( newdistance - maxdistance) / newdistance; vector3 movetarget = new vector3( xdistance * 0.5f * con , ydistance * 0.5f * con, 0.0f ); hinge.rigidbody.moveposition( hinge.transform.position - movetarget ); target.rigidbody.moveposition( target.transform.position + movetarget ); but doesn't take account mass/force or fixtures. can see here want movement on x/y , rotation on z. help? i know isn't answer, add comment button not there. i'm unit...