I have an object (orange) that is tied to a hinge joint (black) and can rotate around it. At some point when I detect collision with other object I have to cut it there (red). In order to do that I want to shrink the object between those points (black and red), but I need it to remain tied to the hinge joint and to keep its width.

void OnCollisionEnter2D(Collision2D collision)
{
GameObject obj = collision.gameObject;
Vector3 endPos =collision.contacts[0].point;
float scaleX = Vector3.Distance(new Vector3(startPos.x, 0, 0), new Vector3(endPos.x, 0, 0));
float scaleY = Vector3.Distance(new Vector3(0, startPos.y, 0), new Vector3(0, endPos.y, 0));
Vector3 newScale = new Vector3(scaleX,scaleY, 1);
obj.transform.parent.transform.localScale = obj.transform.TransformPoint(newScale);
}
And the start position is initialized by the position of the hinge joint:
startPos = GameObject.Find("hair").GetComponent<HingeJoint2D>().transform.position;
I wrapped the object in parent and scaled it, because I read somewhere that then it would remain in place:
I tried many things, but I can’t get it to stay in place and be in right size. How can I implement it right?

