Hi,
Do you want to achieve
A) the character stands upright, gets hit and falls to the floor, or
B) the character stands upright, gets hit, reacts and the gets back to upright?
Achieving B) is possible but a lot more difficult. Let us know if you want to do B. But hopefully you want to achieve A ;-)
For A):
Start with a Ragdoll with disabled joints, limits and motors:
_ragdoll.Pose = _pose;
_ragdoll.UpdateBodiesFromSkeleton(_skeletonPose);
_ragdoll.DisableJoints();
_ragdoll.DisableLimits();
_ragdoll.DisableMotors();
and in each frame call:
_ragdoll.UpdateBodiesFromSkeleton(_skeletonPose);
to move the bodies to upright or animated skeleton position.
Then once you have detetected a hit (similar to the CollisionDetectionOnlyRagdollSample), switch to the passive ragdoll:
_ragdoll.EnableJoints();
_ragdoll.EnableLimits();
foreach (RagdollMotor motor in _ragdoll.Motors)
{
if (motor != null)
{
motor.Mode = RagdollMotorMode.Constraint;
motor.ConstraintDamping = 5;
motor.ConstraintSpring = 0;
}
}
_ragdoll.EnableMotors();
and in each frame call
_ragdoll.UpdateSkeletonFromBodies(_skeletonPose);
That means: First the skeleton controls the bodies. After the hit the bodies control the skeleton.