I need help for Ragdoll

Hi All,

The issue is the ragdoll character is fixed in sky and not falling to floor. After hitting bullet the mesh fall down but skeleton is still fixed in its position. See the code below and attached images. please let me know what wrong in code or 3D model.


    bulletAppState = new BulletAppState();
    Sphere bullet = new Sphere(32, 32, 1.0f, true, false);
    bulletCollisionShape = new SphereCollisionShape(1.0f);
    PhysicsTestHelper.createPhysicsTestWorld(rootNode, assetManager, bulletAppState.getPhysicsSpace());
    model = (Node) assetManager.loadModel("Models/batman_animated/batman_animated.j3o");

    Node controlNode = (Node) findSpatial(model, "Geometry-ogremesh").clone();

    AnimControl control = controlNode.getControl(AnimControl.class);

    SkeletonDebugger skeletonDebug = new SkeletonDebugger("SkeletonControle", control.getSkeleton());
    Material mat2 = new Material(getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
    mat2.setColor("Color", ColorRGBA.Green);

    //Note: PhysicsRagdollControl is still TODO, constructor will change
    ragdoll = new KinematicRagdollControl(10.0f);
    setupBiped(ragdoll, control.getSkeleton());

Running application 1:-

Running application 2 (After hitting bullet):-

Model in JME:-

Rotation, location, scale in Blender :-

Model in Blender :-



You need to remove this line :

and add this line :
bulletAppState.setDebugEnabled(true);//to enable bone and physic debug view

You may look at TestBoneRagdoll.java at JmeTests project .
To create JmeTests project in JME SDK : File β†’ NewProject β†’ JME3 Tests

PS: Recommend to set weightThreshold to 0.5f in this line ragdoll = new KinematicRagdollControl(10.0f);
setting to 10 cause application to crash when switching to native-bullet physic.

Can the character be set to ragdoll mid animation?

Thanks for reply.

I referred the same test class as you mentioned. also I tried weightThreshold to 0.5f but the same result. My basic problem is not how to show bone and physic debug view.

The problem is shown in screen no. 2 and 3. When I start the application, the human character is loaded and set as shown screen 2, it seems there is no effect of physics on it, the character is fixed on the same position until I hit it. When I hit it with bullet, it falls down in ragdoll mode as shown in screen 3 but the skeleton is still fixed in its position.

What I want it when application starts, the character should fall down to floor as a character (not as ragdoll mode). the skeleton should move along with character.

I am not sure what is wrong with this code or 3D model.

You need to set ragdoll.setRagdollMode(); to enable falling but it will fall as ragdoll.

it will fall as ragdoll. Like this:

it is because you are adding skeletonDebug to your scene. Just remove this line rootNode.attachChild(skeletonDebug);

Actually It is moving along with your character but you just do not see it. To get sure that your skeleton is moving with your character you should enable debug view. and it is done by adding this bulletAppState.setDebugEnabled(true);


Thanks Ali… better character control is better solution …

i agree