/// <summary> /// Releases the body from a pull. /// </summary> /// <param name="addForce">If set to <c>true</c> add force.</param> public void ReleaseBody(bool addForce) { //allow the body to move freely again body.IsKinematic = false; //no longer pulling thebody pulling = false; //find the direction from the point masses curerrent position to its respective xformed base shape position. Vector2 direction = ((Vector2)body.transform.TransformPoint(body.Shape.EdgeVertices[pmIndex]) - pointmass.Position).normalized; if(addForce) //ADD FORCE! { body.AddForce(direction * pullBackDistance * force); body.AddForce(direction * pullBackDistance * force, body.Shape.EdgeVertices[pmIndex], true); } }