Doing my first real test with Unity here (it’s awesome by the way!) was wondering if you can smoothly recover from being a ragdoll? For example, in the FPS demo, the robot chases you, you blast him, he flops into a ragdoll, utoh!, then he gets back up!! Can one accomplish this smoothly?
It’s possible, but kind of hard to get looking right.
The question is really, how do you want it to animate when going up?
Most likely you just have a target pose where you want to go.
A simple solution would be to store position/rotation of the bones in an array.
Then sample some animation at a specific frame and store the position/rotation of that.
Then manually lerp/slerp all transform rotation/position over a period of time from the ragdoll pose to the animation pose you stored. When you reach that target, simply start playing the animation.
I think choosing the right animation state where you want the character to end up at is critical for making this work right.
I’d recommend one (or multiple) “standing up from falling” animation; Lerp to the beginning of that animation and then stand up from there. It’ll probably look better.
Agreed, I believe that’s how Lost Planet does it when you get knocked into the snow by the Havok engine. Looks good.
-Jeremy
Actually, I recently found out that Havok has “Ragdolls that get up” and other parametric toys for characters (reacting to a shot, etc) so I am not sure how Lost Planet is doing it.
-Jeremy
How would I go about this, without changing the bones of the ragdoll?
I found animation.Sample(), but the documentation doesn’t say what it actually does. When I run it, my ragdoll just snaps to the default animation. Am I doing something wrong here?
How can I get the position and rotation or the bones from the target animation? I spend all day already fiddling around with this but I just don’t get it.