Still working with getting ragdolls to recover. I've got it working mostly correct but there is an issue with parenting.
My has a ragdoll setup underneath a character controller object. My current process is:
- Ragdoll is initiated by stopping all animation
- Ragdoll will fall outside of character controller
- Unparent the ragdoll from character controller object. This is to prevent the ragdoll from moving when attempting to align the character controller back to it.
- Use "Move Toward" to align the character controller on root bone (pelvis)
- Set ragdoll controller parent back to character controller object
- Use capture pose action and blend new animations for recovery/stand
However after the ragdoll is re-parented to the character controller, it will be moved the equivalent distance that the parent character controller moved during the "move toward" command.
First solution I tried was to set local position of the ragdoll back to 0,0,0. This works but there is a 1 frame delay where you will see the character shift position.
TLDR; I need to be able to set parent and have the child reset local position to 0,0,0 (so the child does not move relative to parent) in the same frame, because using a position action appears to have a 1 frame delay.
I can take some screens if I'm not entirely clear...