2DSkeleton Ragdolls Glitchy

Godot Version



I have been working on adding physics to 2D skeletons in order to generate procedural movement animations for a game I am working on where the player movement will be controlled like a marionette.

The physical bones documentation was not very clear so I began to implement my own solution where the polygon textures for my sprite bones are converted to collision polygons as children to rigidbody2D nodes who’s origins are overlaid with the relevant bone origins. Every frame I set the GlobalPosition and GlobalRotation values of the skeleton bones to the position and rotation of the relevant rigid bodies. I am struggling with the character rapidly rotating out of shape, breaking apart and flying off screen.

Fig 1: The sprite setup

Any help either tuning the physics or just making the movement smooth would be appreciated.

Dropbox Link To Project: