How to make rigidbody connected to other rigidbody and make them follow along when move?

Hello everyone, how I implement this?
VID_20250422103351
When green move, the connected rigidbody, i.e. red and & blue will move along.

Make red and blue children of green. Alternately, make all three the children of a generic Node2D node, then select all four and press the Ctrl+G. Then moving any of the nodes will move them all.

The bending effect is a completely different problem.

Thank you but I want to make it a little bit reallistic. Making it a children of it would just make the object move not look too good.
I instead want that smooth, bending move effect. However I don’t know really know how to implement that..

I don’t know off the top of my head. My thought is probably a tween on the green. You’d also have to track the connection points. Interesting challenge.

Hmm.. that could possibly work, I will try to use tween to see what happens. I was little bit busy now so I will test and tell the result later. Again thank you!

You may be able to use any of the Joint2D nodes available to connect both rigid bodies. Maybe a DampedSpringJoint2D

Thanks. I have tested it, for tween, it didn’t really work out that well and the node can be get overlapped using tween like collision doesn’t exist, which I don’t want that. For DampedSpringJoint suggested by mrcdk… well it kind of worked.. but.. it does not what I want to intend because the joint is not immediately fixed, it also make the green move to adjust along with blue, opposite to what in the gif show.. I still trying to figure this out.

Edit:DampedSpringJoint also doesn’t fixed red and blue to its supposed connection joint point but instead it like orbitting it..

What about Skeleton2D? This person is trying something similar with Godot: https://www.youtube.com/watch?v=T73lvhhw_rA using Line2D.

That example however seems in a way simpler than yours. The way the joint moves in your image seems quite challenging. I don’t see there being a ready-made solution for that. If I had to do something like this, I’d maybe…

  1. draw circle images
  2. draw the flat cutoffs
  3. assemble them like here
  4. fix the distances between the circles so they are always the same distance away hoping that skeletons would do this for me.
  5. then “simply” rotate the cutoff appropriately on the green one when moving. The red and blue don’t need their cutoff rotated, probably, just the whole thing. Probably you don’t need to rotate anything either, if you simply always draw the cutoffs at half distance position.

I have a hard time seeing if the circles are being deformed, but it doesn’t seem like it.

Hello, thank you but I don’t really know how to use Bone or skeleton to create movement like that. I hope Godot have node for these type of joint like in the gif, but unfortunately it is not.
I am trying to create the script for this, how is it work is like
1:Each of these red and blue have its connection/joint point
2:If the red and blue is far away from the joint point, immediately pull toward that way
3:As farther away, means more force is being added.
4:I think I would add where the velocity is distributed to other rigidbody, but I am really noob at physics so I don’t know whether this would work well (I haven’t test this right now)
I am trying implementing these, and I will test and tell the result later, right now I am again a bit busy.

Thanks y’all for helping!

(If anyone wondering where is the gif come from, it’s from Cell Lab)

man, this is so cool, im happy you’re trying to make a cell lab related project

A bit late to see this and reply, but you want a pin joint with motor position targeting. Godot doesn’t have position targeting (yet) but you can emulate it yourself for something soft like that. Rapier physics does have motor position targeting exposed.

If using Godot physics, you set up a PinJoint2D for each attached cell, place the joints in the center of the middle cell so that the outer cells will rotate around that. Then you will need custom _physics_process() code to create an angular spring effect that gives the outer cells a spring based torque or force that tries to restore their original angular orientation relative to the center cell.

Or use the Rapier Physics add on, and change the type of your PinJoint2D to RapierPinJoint2D. Then in the inspector you will see options for motor position targeting. Set the target velocity to 0.0, target angle to 0.0, and then change the stiffness and damping options to get the lag and bounce you are after.

I would like to add motor/drive position targeting to Godot 2D physics (in time) as part of a larger proposal to add soft constraints, so if you see a proposal like that pop up on the Godot Proposals GitHub, you know what it is and can support it.