Sticky objects 2D fixed joint

I’m working on a game, where I dynamically attach and detach various moving objects to each other (i.e. I have some sticky objects). Currently, I’m doing this by making one of the moving objects a child of the other, and removing the rigidbody component from the child. However, this means that the child object no longer acts independently when colliding with other objects (I want objects stuck together to knocked apart when hit with sufficient force).

After a bit of investigation, I found that what I really wanted was to attach the two objects using a FixedJoint - but there is currently no FixedJoint2D component available.

Does anyone know of a plan to implement this component in 2D in the near future, or does anyone have any ideas on how to implement this myself in the mean time?

Not sure when it will be added, I’m sure at some point. In the meantime, you might be able to accomplish what you are trying to do with a DistanceJoint2D.

Actually since the current implementation of DistanceJoint2D has a bug which makes it act like a RopeJoint, I would instead suggest you use a HingeJoint2D with the motor turned on and a motor speed of zero. The motor will prevent the joint from moving.

Thanks for the suggestions guys. I tried using a HingeJoint2D with a motor, but this led to some very strange behaviour when I attached a normal physics object to a rotating kinematic physics object. I would also have to implement my own “breaking” behaviour to the joint. For now, I’ll probably move on to something else and wait for the 2D implementation to mature a little.

Reviving this old thread to see if anyone had gone through this already and has found an alternative solution to this problem?

What is your specific problem that you are trying to solve?