Hello everyone, how I implement this?
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…
- draw circle images
- draw the flat cutoffs
- assemble them like here
- fix the distances between the circles so they are always the same distance away hoping that skeletons would do this for me.
- 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)