How to load a ragdol in?

hello it sounds very simple i know, ok I made the ragdoll for the character and I got the character all setup and animated functioning well, but when I wan the character to die and be replaced by the same character only rigged with ragdoll… so the corpse can be tossed about a bit before finally disappearing very rudimentary, but for the life of me can’t figure out how to load the Ragdol rig to actually work…

PLEASE HELP!!!

I tryipcally make a ragdoll with ridid body joints, make sure there rotations match up with the bone they are mimicing in the orignal armature and then target that with armature copy rotation constraints in the ragdoll armature.

  • make a group of the ragdoll with it’s origin at 0,0,0 on a hidden layer.
    add a instance of the group (this is what you will be adding to the scene later is the instance)

to make the pose match the death pose of the agent is also tricky

I parent a emtpy to each bone that will be limp and give it a property
BoneCopy that is a string - which is the name of the ragdoll bone that will match it.

in the enemy have

if heatlth <=0: --------------python

import bge
own = bge.logic.getCurrentController.owner

added = own.scene.addObject( 'RagDollGroupInstanceName', own, time)

for child in own.childrenRecursive:
     if 'BoneCopy' in child:
         for member in added.groupMembers:
             if member.name == child['BoneCopy']:
                  member.worldTransorm = child.worldTransform