Skip to content
Hibiiro

HIBIIRO

Trying Out the Ragdoll System in Godot 4.3 with PhysicalBoneSimulator3D

Introduction

Working with Godot has been a lot of fun.
Since I want to build a goofy physics-driven game, I decided to learn how Godot’s ragdoll system works.
There wasn’t much documentation beyond the official manual—either in Japanese or English—so it took quite a bit of trial and error to get everything moving properly. Once you understand how it’s structured, though, setting up ragdoll physics in Godot feels even simpler than in Blender.

Environment

Godot 4.3

Setting Up the Ragdoll System

Creating the Physical Skeleton

First, import the rigged 3D character you want to use with the ragdoll system.

Imported character model in Godot 4.3

About the Character Model
I kept the armature minimal, adding bones only for the body parts I wanted to move.
As explained below, when generating the physical skeleton automatically, leaf bones at the end of the hierarchy (the 3rd level from the root in this rig, such as head) did not get automatic PhysicalBone3D nodes.

After importing the model and creating an inherited scene, select the Skeleton3D node.
Click the Skeleton3D menu in the top viewport toolbar and select Create Physical Skeleton.

Creating a physical skeleton from Skeleton3D toolbar in Godot

That completes about 90% of the setup needed to get it moving! Next, attach a script to the newly created PhysicalBoneSimulator3D node.

Attaching a script to PhysicalBoneSimulator3D

In GDScript, you only need to add a single line inside func _ready():

func _ready() -> void:
	physical_bones_start_simulation()

Placing the Ragdoll in a Scene and Testing

Place a ground floor and a camera in your main scene, drop in the character scene, and run the project.

Initial ragdoll simulation test in Godot 4.3

The physics simulation starts without errors, which is a great first step—but some extremities don’t have physical bones yet, and the joint movement doesn’t look quite like a human body.

Adding and Configuring Physical Bones

Adding Missing Physical Bones

With my rig hierarchy, Godot didn’t automatically generate PhysicalBone3D nodes for the leaf bones at the tips of the chains.

It wasn’t a big deal here since we can add them manually, though I wonder if adding leaf bones in Blender beforehand would make them generate automatically.

To add them manually, add a PhysicalBone3D node as a child of PhysicalBoneSimulator3D in the character scene.

Adding PhysicalBone3D under PhysicalBoneSimulator3D

In the Inspector for the new PhysicalBone3D, assign the target bone name.

Selecting Bone Name in PhysicalBone3D Inspector

Next, add a CollisionShape3D child to the PhysicalBone3D.

Adding CollisionShape3D to PhysicalBone3D

Choose a shape in the CollisionShape3D Inspector and resize/position it to match the mesh.

Adjusting CollisionShape3D size and transform

Making each collision shape slightly smaller than the character’s mesh helps prevent neighbouring bones from snagging on each other and gives cleaner physics behavior.

For symmetrical left/right bones, once you configure one side, you can simply copy and paste the transform values (inverting the X coordinate) to save time.

Joint Configuration

Once all physical bones are in place, select each PhysicalBone3D and change its Joint Type in the Inspector to 6DOFJoint.

Setting Joint Type to 6DOFJoint

I experimented with the other joint types as well, and found that 6DOFJoint‘s default constraint limits matched natural body movement right out of the box.

The documentation also lists methods for setting joint types via script if you want to automate this across rigs with many bones.

Running the project after applying 6DOFJoint to the physical bones produced the exact ragdoll motion I was hoping for:

Completed ragdoll simulation with 6DOFJoint constraints

Here is another test from an earlier prototype project whose bouncier feel I liked even more:

Ragdoll physics test in an earlier Godot prototype

Small tweaks to collision shapes and joint constraints make a big difference in how the ragdoll tumbles, so try experimenting with different values!

Closing Thoughts

Ragdoll physics is essential for the game I want to build, so I will keep exploring Godot’s physics engine.