add joints on objects dinamically

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By jospic
:warning: Old Version Published before Godot 3 was released.

I am a beginner in Godot Engine, and I’m performing some experiments .
I have a problem to create dynamic objects though GDScript…
In the small attached project example , I’ve created with no problems instances of objects , connected by PinJoint2D . When I added, from code, additional instances of objects, they are not connected by joints .
In the example there is a snake consists of a head and two body parts (added manually as instance from editor).
Then, from code if I add many more pieces. They are properly displayed but are not connected to the rest of the snake (as shown in the figure, when moving the head). Where is the issue? I’m going crazy. Thanks for the help.

Project files.zip

Did you ever fix this? It’s 2019 and this question is still not answered - and I am having the same issues.

Fireflash | 2019-03-19 05:25