How to create a chain between two points? (2D)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By wbgyor

There are two points say A and B. I want to join these two points with a straight chain. I have a sprite which is one segment of the chain. These segments are needed to be placed back to back from point A to B so that it looks like a chain. How can I achieve this?

:bust_in_silhouette: Reply From: CharlesMerriam

The answer is always “it depends”, though someone with more Godot experience might help. As always, this is a guess about what your question asks: feel free to add to it.

First, you probably want to make sprite with a long chain. Then you can place it, but constrain the rendering size to the portion between the anchors. That is, you have a long chain but only show the visible links. For a curved chain (catenary shape), your sprite should look OK by cutting off both ends and showing the centers. You may want a separate sprite for the first couple of links: a parial link shows more at the ends than the center.

Are you looking at how Godot can render that? Or worried about the physics of the chain?