Best way to return ragdoll back to its original position (physics v2)

Hi everyone, short question about the new ragdoll system that I just noticed being added recently, very nice!

I noticed this example: Ragdoll | Babylon.js Playground (babylonjs.com)

My question is; how easy it would be to de-ragdoll the character back to its original position/animation? Use case would be similar to many games; you have a character that has been animated and has a skeleton, gets turned into a ragdoll in some case (f.e. character faints) and then recovers from the ragdoll stage back to some animation. Probably this returning to animation would need to be somewhat interpolated as well :thinking: Any thoughts on the matter? :pray:

Hello there!

The ragdoll has a property named pauseSync that can be used for this purpose. You could save the character’s position on each bone to the rest pose, then when you want to go back to that, use returnToRest on each bone: Ragdoll | Babylon.js Playground (babylonjs.com), through this happens instantaneously, without an animation. Maybe you could have something like a lying down rest pose, then return to that rest pose and animate from the rest to a standing position back again.

1 Like

Nice, this is a cool starting point! I think most games do something like this, but they kind of try to animate the process of returning to the rest/animation pose from the ragdoll position, so it “looks better”…

Any idea/hunch how this could be implemented in Babylon? :thinking:

You could construct an animation from the current pose to the rest pose! Something like: Ragdoll | Babylon.js Playground (babylonjs.com)

2 Likes

Wow thanks for wrapping that up, I can continue with this! :star_struck:

1 Like