Active ragdoll in Godot 4.5: how to achieve good results?

Godot Version

4.5

Question

I’m working on a 2.5D game in Godot 4.5 that uses skeletal animation + ragdoll physics.
I’m really happy with how the full ragdoll mode behaves, but I can’t get anything close to a good active ragdoll result.

I’m using PhysicalBoneSimulator3D and blending between animation - physics - animation by adjusting the influence property.

Has anyone achieved a nice active ragdoll setup in Godot 4.x?

Here’s the simplified version of my current code:

func _on_hurtbox_body_entered(body: Node3D):
  activate_ragdoll()

  var tween = create_tween()
  tween.tween_interval(0.25)
  tween.tween_property(physical_bone_simulator, "influence", 0.0, 0.5)\
    .set_ease(Tween.EASE_OUT)
  tween.tween_callback(Callable(self, "deactivate_ragdoll"))


func activate_ragdoll(influence: float):
  animation_tree.active = false
  collider.set_deferred("disabled", true)
  physical_bone_simulator.physical_bones_start_simulation()
  physical_bone_simulator.influence = 0.8


func deactivate_ragdoll():
  physical_bone_simulator.influence = 0.0
  physical_bone_simulator.physical_bones_stop_simulation()
  collider.set_deferred("disabled", false)
  animation_tree.active = true

Active Ragdoll: Needs Improvement

ragdoll-test-5

Full Ragdoll: Works Great

ragdoll-test-6

This looks really good! Sry, can’t help you though.

1 Like

Maybe anticipate the impact and switch to a more stable pose … perhaps the joints for the legs and lower back could have greater stiffness than the arms.

I am always looking for more on this subject.

Perhaps the tween.EASE_OUT isnt a physically accurate model for the movement … does that blend toward the animation at the end of the impact time? How long does the actuall impact last? Perhaps the value 0.5 in the tween should change for different impacts.

1 Like

Have you tried not de-activating the animation tree? I think it could look better if the character was still trying to walk, or do a stumble animation, while partially ragdolling.

1 Like

Yes, it’s true. I removed animation_tree.active = false, and active ragdoll does indeed look better. Thanks!

1 Like