RigidBody2Ds and PinJoint2D "anomaly"

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

Hi all,

I am working on my 2d character’s death :). This will be a ragdoll-like effect (I don’t know how to say this sorry).
I am using rigid bodies (with collision polygons) as body parts (head/arm/leg… etc), and pin joints to connect them.

It works approximatiely as I expected:
enter image description here

My problem is that the gravity is too slow, so I changed the “gravity scale” property from 1 to 50 (in all rigid bodies).

From this point everything goes wrong.

The second gif shows the funny result:
enter image description here

What am I doing wrong?
Is there a relevant tutorial about these tools somewhere?

Thank you!

Instead of gravity scale try changing the mass of the different ragdoll parts.

eons | 2017-02-26 17:30

Thank you for the answer!

I am not a physics expert, but IMO the mass has no effect on the speed/acceleration of free fall.
I noticed, that sometimes the bodies ignore their collisionshapes, and go to wrong states (overlap each other)… then the character goes mad :).
I have no idea yet…

bruteforce | 2017-02-26 18:36

I made a simplified project, which shows a similar issue.
It has only 2 rigid bodies and 1 pin joint.
Link: google drive

Can you check it?

Thanks a lot!

bruteforce | 2017-02-26 18:52

Free fall in a vacuum does not depend on mass, but default settings have something else, the linear damp, which is non zero by default, and may affect it on some motions.

The mass will affect the bounces too.

I’ll check the project.

eons | 2017-02-26 19:42

Tried with 0 damp on one of the bodies and feels better, 128 damp on red and you get a nice (but useless) parachute xD

eons | 2017-02-26 19:53

Thanks again!

You are right, I tried 0 damp, and it is really better!
But the real project has 16 bodies connected and I don’t know which one(s) should I choose :slight_smile: ?
I’m not familiar with these settings (ie. damp - linear/angular), so now i’m just randomly trying… I have to learn more!
I need coffee!

bruteforce | 2017-02-26 20:19

Well, I’m kind of confused by the damp, I think that on other physics engines is different or scaled up (and the way mass affects the damp is weird).

Not sure how will be the best combination, you may need to put your ragdoll on horrible situations and see how reacts to different settings, use live edit too, that will be faster to test.

I use to override all the physics settings with a huge area with space override (replacing damp, gravity), maybe is not the optimal method but that way I have a quick access to some general physics settings on the editor.

Oh, and high friction may help some parts to get stuck on surfaces

eons | 2017-02-26 20:45

:bust_in_silhouette: Reply From: bruteforce

I don’t have a solution yet, but I found the simplified question… maybe :):

What could be the reason that a pin joint connection is breaking (just for a moment, but that’s enough), and how can I prevent this?