Active ragdolls in Godot + Jolt; is it even possible?

Godot Version

4.4.1

Question

Hi,

I’m sorry if this is a dumb question, I’m still a new to this whole world.

I’m trying to create an active ragdoll NPC in my game, but I just can’t get it to work .
I got the ‘ragdoll’ part down pretty good, it’s the ‘active’ part that I’m having a lot of trouble with.
I have a character model with a proper skeleton with baked-in animations (from Blender)
I used PhysicalBone3d nodes for each bone in the Skeleton.
I gave the physical bones their own collision shapes.
Doing all that I managed to create a pretty good ragdoll (that just collapses whenever the game starts)
Then I set an ‘idle’ animation to continuously play in the character’s animation tree and set bone simulation to be ‘off’ by default.
I wanted to make it so that when a bullet (raycast) hits a bodypart (a PhysicalBone3d) bone simulation would turn back on on that specific bodypart, and a knockback effect (that I set on the gun/bullet earlier) would move the bodypart away from it’s position in the animation and then the bone simulation would turn off again and the bodypart would return to it’s place in the animation (I hope this all makes sense so far, I’m not good at describing stuff either)

This “almost” worked, but every time the “ragdolling” bodypart would snap back into it’s original position instantly which looked really weird. Imagine you move your hand up to your ear and when you want to lower it back down, it just “teleports” to that position.
So this attempt failed.

Then I tried to follow this tutorial on YT, but that just exploded my character to bits, no matter how much I tweaked the values:

Yea, I know, it’s an old video that doesn’t really apply to 4.4 and Jolt, but I tried anyway.

Anyway, I was just wondering if anyone out there managed to get active ragdolls to work properly. Is it even doable yet?
If you have any tips or study material or anything, please do share! Like I said, I’m new here and I don’t know nearly as much about any of this stuff as I’d like to.

Thank you very much in advance!

1 Like

I have basically the same issue I don’t even know bro Iv’e been trying to find an answer for forever

I got this to work however when i tried to import it to my game i had problems with the animations seeming very broken, and warped. I think i had problems synchronising the active ragdoll orientation witb the player - i might have another look at the project . I also couldnt seem to set the spring stiffness to something like an infinite value to ensure the physics bones positions perfectly synchronised with the animation.

I would like to use it just for hit reactions to physical attacks … these systems are usually a bit unrealistic looking when used for the full range of animations.

I think a decent biped robot implementation could be the future of animation …

Just an update … my previous answer was bad because the spring stiffness can in fact be made to cause the physics character to closely match the animation.
The jolt engine does not fire the balls in the same way - they are much heavier and drop to the floor quickly. Also a couple of implementations were unstable in jolt, but i got a version of the basic demo shown above working quite well for the strafe right animation … however it would behave strangely after a ball knocked the feet off course.

Maybe it could work with the right tweaks …

A point to note is that the 4 linear/rotational spring and damper coefficients are for all joints in the skeleton, so the individual coefficients and masses could be tweaked for more realism. I think the masses can be changed for individual bones anyway.