@lubos what would be your idea of to-ragdoll and from-ragdoll transition in script?
i.e. character falls or thrown in air (even player character), so it plays animation, does ragdoll transition,
behaves like ragdoll for some time, then from-ragdoll transition + using best-match animation recovers.
How this is to be implemented in Armory? In other engines I do the following:
- Play layered animation in preparation for ragdoll (some kind of reaction which is procedurally created from animation chunks which suits best for what happened).
- As animation complete or when I want I create RigidBody on each bone I’m interested in and add constraints between them. The ragdoll/constraint set up is done in code but copies some visual set up. (I think for Armory it could be done by setting up 2 objects/scenes with ragdolled and non-ragdolled character for transition, but transition itself requires some heavy coding to be seamless).
- The behavior of ragdoll, i.e. doing whatever ragdoll does. This one is quite clear.
- Disabling all RigidBodies and removing them converting to that of pre-ragdoll state, but having all bone poses like they were last left by ragdoll.
- Looking up a set of animations which best match current bone pose. As we found one we blend to it (cold add some code to do some checks and hacks so to reduce bad effects if there are some, like feet sliding or other visible things).
- Ragdoll state finishes we’re going back to our business.
So to implement this scene some blank spots are needed to be filled.
- Manual transition to ragdoll requires reading of exisiting ragdoll setup and recreating that on current mesh. This looks doable, but I really can’t understand where to start. The main problem is getting current animation state. Would be nice to have some example of attaching RigidBody to a bone script. This might also become useful for some effects too (cheap hair/cloth physics, etc.). For me the main problem is not knowing data organisation for all things I need there, need more examples for that…
- The transition back needs access to animation data for matching (first few frames access is enough),
is there any information on how to access that from script?
I think such thing is local enough to be implemented as node, I wonder how usable that would be…