- Home /
Hingejoint2D's anchor pushed away from connected anchor
I have a rigidbody2d with a hingejoint2d connected to it and nothing else, so as to "pin" the rigidbody and have it rotate around a fixed point.
This works ok, unless there are other rigidbodies resting on the hinged one. In that case, the hinge connected anchor is slowly drifting away from the anchor, and cannot seem to hold the weight of the rigidbodies resting on it.
Is there a way to prevent the anchors from separating and making a firmly pinned rigidbody rotate around the hinge?
All the rigidbodies have a mass of 100, Gravity Scale is 50 and gravity is 20.
Thanks!
Answer by CalebFnord · Sep 30, 2014 at 07:42 AM
Eventually solved by setting the mass of the carrying object to a high value (I used 1000), and the resting objects to a low value (used 1).
The hinge is now firmly holding the carrying object and all the objects resting upon without visibly moving (there is a slight movement apparent in the object's transform).
If both the carrier and the objects being held have the same mass, whatever the value, the issue recurs.
Answer by patrusfarr · Aug 12, 2016 at 02:39 PM
I had a similar problem with two Rigidbody2Ds connected by hinge joint where if the transform.position of the connected Rigidbody2D was changed via script, the connected anchor would drift during run-time. I fixed this by turning off auto set for connected anchor point in the inspector of the Hinge joint. This must be a bug because I would think the anchor points should not change on their own.
Answer by infernobirdy · Dec 13, 2014 at 05:56 PM
You need to activate the "IsKinematic" value in the carrying RigidBody.
This is not a matter of 2 rigidbodies hinged together, it is a single Rigidbody with a hinge, producing the effect that it is hinged to the background.
Answer by aneedham0577 · Apr 16, 2021 at 07:44 PM
Go into Project setting --> Physics2D and set Default Connect Offset to the lowest it can go. This fixed it for me.
Your answer
Follow this Question
Related Questions
Creating a simple swinging vine/rope/line 0 Answers
Create a simple constantly swinging vine/rope 1 Answer
2D car brakes help??? 1 Answer
Rigidbody2D freezes 0 Answers