• 2D
  • Problems creating joints via script

I've been trying to make a pendulum object via script. Made from a static body with a joint, attached to a rigid body line segment with another joint at the end, finally attached to a rigid body circle shape.

When I build it via the editor it works fine, but when I try to construct it via code it falls apart.

Example image: a = Constructed in the editor b = Objects placed in the editor, disabled and without gravity. The local positions are exact copies of the editor-built nodes. c = Gravity applied, first joint attached, but arm-to-ball joint not attached (The ball has fallen slightly in the screenshot). d (Bug) = Circle connected to arm, which causes it to move to a new position. e = Collision shapes enabled, the circle and arm spin out of control.

I don't understand why the circle moves when I connect it. I'd really appreciate if someone could offer some insight as I'm stumped.

My project as a zip is attached to this post if anyone wants to take a look.

Thanks!

8 days later

I downloaded the project and tried a bunch of things with no solutions found. I would suggest opening an issue on the Godot GitHub repository, as I am fairly certain this is a bug.