Is it impossible to position a PinJoint2D node through code?

Godot Version

Godot 4

Question

I’ve tried everything from freezing physics in integrate_forces() then positioning, changing position from code, declaring at _ready() etc. etc. but every single time the PinJoint2D position reverts to (0, 0). It’s so frustrating that a task so simple can’t be done in Godot. Anyone else experienced this and if so what was your fix?

If you position a joint dynamically you probably should only change it in the physics process. Also, if you have both bodies attached you may need to unattach a body, reposition joint, and reattach body.

I dont think i have had this issue. I add joint to scene, position it, and the bodies, and then attach bodies.

1 Like

Thanks a lot that fixed my problem!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.