We are currently trying to ragdoll enemies in response to player AoE attacks (explosions etc) and then have them recover using the physics to animation blend weight. However, we have run into a problem where when we ragdoll the character the mesh is becoming separated from the character’s capsule component, which is preventing us from blending back into animation control.
Does anyone know a way we can keep the mesh firmly attached to the capsule at all times?
We did actually. We found that the skeletal mesh needed a dedicated root bone at the top of hierarchy, rather than as we had it using the hips as the root.
However, be warned, we also found that blending back from physics to animation caused a crash bug in our game so the feature has since been cut.
Aha, so when you changed the root, the physic mesh automatically stayed attached to the capsule?
I kind of got it working by simulating physics on selected bones instead of activating the full ragdoll, but had problems with the capsule component not syncing properly across server and clients.
After ragdoll the capsule is detached from the mesh, but it can be re-attached. Here the code for the AI. Collision settings depend on your character collision settings.