Ragdoll how to make
Ragdoll how to make
Ragdoll how to make
57 | уникальных посетителей |
1 | добавили в избранное |
get 5 cinder blockes
place 3 laying on the ground next to eachother WELD THEM NOW
plase 2 cinder blocks standing up on the back of the left and right cinder block row(the 3 from before)
MAKE SURE WELDED OR U WILL DIE
get tall red propane tank and stand it up inbetween the 2 standing left and right cinder blocks (WELD TOO, AND IT HAS TO BE THE RED ONE OTHERWISE I WILL BE DISPLEASED WITH UR AESTHETIC CHOISES)
get ragdoll (bonus points if gman because gman funni.) and make statue of what ever pose u want it to be in, face pose optional
stand the ragdoll up by shoveing the red propane canister up its arse, then fricking weld that thing together
have you welded EVERYTHING together? this is the step in which you double check. dont worry, there will not be another step like this in this guide. 😉
get thrusters make it go to walking speed and place on the top half of the back of the 2 standing cinder blocks, there should be two thrusters at this point, and no more until
hope you enjoyed that little transition there, it took me like an hour to figure it out lmao rofl copter XD OwO UwU OwU
ANYWAY
place another thruster with the same settings as before on the middle cinder block of the 3 laying down ones.
make sure everything is welded to eachother. make sure to weld everything to the ground too.
place another thruster with the same settings as before on the middle back of the propane tank. use this step as an opportunity to double, then trippple check that the propane tank is the TALL RED ONE, not the shi t ty SMALL EXPLOSIVE ONE, and if it is, in fact, the small explosive one, cry, and re-evaluate your life choices as you are now forced to spam the undo button, and you now have to start all over again from step 1.
ignore step eleven because otherwise this wont work at all, haha trolled u lololololol
get ur color tool and make everything but ragdol (MUST STILL BE FUNNI GMAN) invisible
press thruster button for a second, and ur ragdoll will appear to jump forward! oops, not what i intended at all for this, but i guess its cool too? idk lol i just make this up as i went along.
thank u for to a so reading my guide. goodluck with ur therapy, u blonb.
How to make Active Ragdolls in Unity
Unleash the power of physical animations
I’ ve always loved how some games use animations that seem to generate naturally depending on the environment. Like how in Uncharted Nathan uses his hands to explore nearby objects when you pass by, or how in GTA you get these amazing reactions to collisions.
So, I started investigating procedural animation systems and came across a technique called physical animations, also known as active ragdolls. The concept is actually pretty simple, make a ragdoll try to match an animation by applying forces to its body parts. This way the animation is physically simulated, which allows for more realistic interactions with the environment.
This post is specifically about how to do this in Unity, but I’ve also made a more distended video where I show you how I made my own active ragdoll system, which you can find here as well. Feel free to use it as you please.
Before we start, I have to say that making good active ragdolls is not that hard, but it’s quite messy. You don’t need to be a genius or have amazing programming skills, but being tidy and keeping your project under control will save you a lot of headaches.
If you find it interesting, just try to make it work! In the worst case, you’ll probably end up with something cool to show to your friends.
Preparations
Model & Skeleton
Any model can work with physical animations, that won’t be a problem per se. If there’s a problem, it will be with the skeleton. I recommend avoiding very complex skeletons. Fingers, for example, add a lot of unnecessary complexity.
Also, only export deform bones and don’t export leaf bones, it will simplify the structure in Unity. If you’re using Blender, it will look somewhat like this:
Animations
I recommend having at least these 3 basic animations for your model:
Physics
Configuring the physics is as important as it can be. If you skip this step, literally nothing will work.
Finding the exact positions and velocities of objects after they interact with each other is a very computationally expensive process. That’s why physics engines use iterative solvers, which make approximations that get better and better after each iteration.
We’ll be creating a complex physical system, with many Rigidbodies connected by joints. If we do not get good approximations, our active ragdoll won’t work at all. Unity’s solver doesn’t do many iterations by default, so we need to pump those values up.
This can be done by changing the Solver Iterations and Velocity Solver Iterations, which basically tells the engine how many times to let the solvers iterate when the physics are updated. Of course, more iterations demand more on the hardware. I’ve seen that values above 8 for both of them achieve good results.
It’s also useful to boost the maximum angular speed, this won’t be as noticeable but it will make the ragdoll more agile in some situations. The default for Unity is 7, I have seen that any value over 20 is enough for active ragdolls, but it depends on how fast you want it to move.
You can change both the solver iterations and the maximum angular speed directly for all the rigid bodies in your game, by going into the physics section of the project settings. Or you can set them from code for each Rigidbody independently, which is very useful to only spend processing power on the ragdolls, and let the rest of the simulation be less precise.
Unless you are using this in a commercial or big project, just change them in the project settings, you won’t feel the difference.
Setting up the bodies
Here’s where it gets messy. We need to have two separate bodies, one for animation and one for the actual active ragdolling. I recommend grouping those two under one parent object, so you can easily move it around, make prefabs, put scripts on it…
The Animated Body
This will be a standard animated character, nothing fancy going on here. We need this as a reference that our ragdoll will try to match. Unity makes a Game Object for each bone in the model’s skeleton, this will come in handy for later matching motion.
The Physical Body
I’m going to throw a detailed explanation of how to configure an active ragdoll properly. So this section is going to be quite long, and if you’ve never done something like this, it might be also hard to understand.
I say this not to scare you, but so you won’t get frustrated if it doesn’t work right away and you have to go back multiple times, or even do some research on your own. I also had major issues and misunderstandings the first time I did it, but I learned a lot and got it working in the end.
Now, we need to configure this as a ragdoll, the first step is adding a Rigidbody to each body part and setting an adequate weight, I use this as a reference of weight per body part for humanoids. Maybe you’ll want to avoid adding Rigidbodies to some bones, such as the fingers, but that will depend on your model and your goals, so do what goes best for you.
After you’ve set up all of your rigid bodies, you need to connect them through joints. Joints are just physical entities that link two rigid bodies together, making them rotate and move around each other in a certain [configurable] way.
For active ragdolls in Unity, we need to use Configurable Joints. Those are the more abstract type of joints, meaning that you can achieve the same behavior as any other joint with it. But we use them primarily because of one function, the Target Rotation. This is used to tell the joint to rotate towards a specific rotation, using the spring forces defined by its angular drives.
First, we need to add a ConfigurableJoint component to each body part and set the connected body to its parent. For example, we should add a ConfigurableJoint to the forearm that connects it to the upper arm, and one to the upper arm that connects it to the chest/ribs.
Of course, since one joint connects two body parts, you will have one less joint than body parts. Generally, you’ll want the joint-less Game Object to be the root of your character, which is usually the hips or the torso.
If you play now, you should see that your body is already kind of a ragdoll. I say ‘kind of’ because ragdolls limit the rotation of their joints, and this one still doesn’t.
Setting up the rotational limits of joints is a very specific process for each model, as well as counterintuitive in most cases, so I can’t help you much here.
You’ll need to set the axis and secondary axis properly for each joint, by tweaking the Axis and Secondary Axis vectors in the inspector. The X-axis should represent the main movement of a particular joint since it is more configurable than the other two. This is impossible to explain with words, so let’s see it with an image better.
You can hit the Edit Angular Limits button to see the axis visually. But this is just to see it more clearly, this won’t allow you to actually change them visually, it’s intended to modify the limits, which we’ll see later.
Still, I don’t think you can understand this well enough with an image either, you’ll need to play with those axis values and see how that affects the joint. If you can’t get it working in your project, I recommend you to download mine, which is already configured, and fool with it to get a hold of how joints work.
After getting each joint right, you need to lock those axes that you don’t want movement on. For example, you only want the knee to rotate around one axis (the one that allows the extension of the leg), so lock the other two.
Let’s now configure the limits. You can hit the Edit Angular Limits button we talked about before, and manipulate them visually in the editor. You can also change the numbers directly in the component’s configuration, but that won’t be as easy.
Finally, you just need to configure the Angular Drives so joints can apply torque to match the target rotation. If you just want to get it working without more delay, you can set a high spring for every joint, and worry about polishing it later. The movement might look a bit rough, but it will work anyway.
Matching motion
You should now have a character GameObject with two bodies, one animated and hidden, and the other the active ragdoll itself. We just need to tell the active ragdoll to replicate the movement of the animated one, and we will do so with the Target Rotation feature I talked about before.
We need a script that sets the target rotation of each joint to that of its equivalent animated body part. Of course, nothing is easy with active ragdolls, and we can’t just set the target rotation to the rotation of its equivalent animated body part, because Quaternions are evil monsters.
I have to admit that I have no idea how to do this, that’s why I used this Configurable Joints Extension made by Michael Stevenson, it works flawlessly. The only extra thing we need is to save the initial local rotation of each joint, since it is required to calculate the target rotation.
So to summarize:
And this is it, your active ragdoll should be physically playing an animation now!
A few more notes here.
Remember that you need to play an animation with your animated body, make this one visible again and see if it’s moving properly. If the animated is moving but the ragdoll isn’t, then the problem lays in the active ragdoll implementation.
I don’t think the fixed update improves anything here, since the animation changes at the frequency of the Update loop, but I find it clearer to do physics things on the fixed update.
And last, as I said a couple of times already in this post, if you can’t get it working, I highly recommend you download my implementation, play around with it and see what’s different from yours. You can find the details of motion matching in the Animation Module script.
Balance
You probably noticed a big flaw of active ragdolls, it just falls. It’s useless unless we balance it in some way. Natural balance is an incredibly hard problem, which has been investigated for years in the field of robotics. I’m very passionate about the topic, but it’s way out of the scope of this tutorial.
So, we’ll have to just force our active ragdoll to stay up by adding some artificial forces into the mix. I’ve found 3 ways to achieve artificial balance, each with its pros and cons:
For me, the manual torque solution is the best, but the joint works well too, and it’s easier to set up. I see little reason to lock the rotations, it works horribly in my experience. For very small projects it could be enough, it’s actually quite stable if you don’t do anything fancy. But who makes active ragdolls not to do anything fancy with them?
If you know any other method to artificially balance, please let me know in a comment, I’ll appreciate it.
Inverse Kinematics
This topic would require another extended post, so I’ll just explain what Inverse Kinematics is about and why it can be useful with active ragdolls.
Standard animations have one major flaw, they cannot be dynamically adapted depending on the context. Active Ragdolls solve part of the problem, by making animations interact with the physical environment. But there are more ways to make animations more dynamic.
One of the most common ways to improve animations is to generate movement that targets certain objects in space. For example, making the hand target something you want the character to grip. To do this, you need to define a target position and rotation for a certain body part, and then find a way to set up all of its parents to allow for the target to be reached.
That means solving a group of equations to find how each parent rigid body should be positioned and rotated, this mathematical process is called Inverse Kinematics. But there’s a problem, the number of solutions to those equations is infinite, you can reach the same spot with your hand in infinitely different ways.
To solve this uncertainty, inverse kinematics solvers need hints, which are objects in space that tell where a certain rigid body in the kinematic chain should point to. Following the previous example, we need a hint to tell the elbow where to point. That constrains the solver, though reducing the solution space and allowing it to find a solution.
Unity has an Inverse Kinematics built-in, I’ve run into some problems while using it, so I can’t say I’m a big fan. But if you just want to mess around with IK, it’s easy to use right away.
Thank you for reading all until the end! I hope you learned how to make active ragdolls in Unity, feel free to make any suggestions in the comments or to contribute to the repository.
Ragdoll how to make
Before we get started, you NEED Basic Experience in Blender.
You also need these items to get everything to work.
-=Code Editors=-
Note: Either one of these work, I prefer to use Sublime Text though. (I’ll be using it in this Guide.)
I’ll be using this Ragdoll.
We’ll be using this guy for our Valve Skeleton.
There’s many ways to make Playermodels, but I know three ways; Turning a Ragdoll into a Playermodel, Taking a (Non-Source) Base Model into a Playermodel, and Taking a Custom Model and making it into a Playermodel.
In this Guide, I’ll be showing you how to turn a Ragdoll into a Playermodel (For the sake of any beginners, and it saving a lot of time.)
4,724 | уникальных посетителей |
247 | добавили в избранное |
First, we’re going to create a folder on our Desktop, call it whatever you’d like. (Make sure there are no spaces, if you want a «space» use the «_» underscore!) For this tutorial, it’s going to be «Tutorial_PM»
Then, make three folders. (lua, materials, and models)
Next, make another folder, on your Desktop. (You can just name it the Ragdoll you’re making into a Playermodel.)
Open GMPU; It’ll probably look like this:
That’s okay! It’s just GMPU needing Garry’s Mod’s bin directory.
All you have to do is get the directory (Default would be; C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\bin), and type (or Copy/Paste.) them into both, «GMAD.exe», and «GMPublish,» then hit «OK.»
Make a folder on your Desktop, called «Ragdoll_Decompiled», this is where we’ll be having the extracted GMA put all of it’s files in.
(It doesn’t have to be «Ragdoll_Decompiled», but for the sake of this tutorial, I named it that.)
Now we need to go to the «Extract» tab with GMPU. It’s a simple click.
At the bottom, it says, «Extract», and under that is, «File:», click on the button «File», and the go to your Garry’s Mod addons folder.
(Default directory; C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod\addons)
Now, you need to find the Ragdoll you’re Extracting; For this tutorial, it’d be, «nypd_ragdolls» as a GMA file.
Once you’ve selected that, it should appear in the box. After you’re done, check the «Out» box. Now we can click, «Folder», and tell the computer where to extract our GMA. Click «Add to Queue», then «Execute.»
After you Execute, you should have the Log fill up with a bunch of stuff, and your, «Ragdoll_Decompiled» folder should have folders in it.
Make another folder on your Desktop, name it, «Skeleton.» Now, you do the same process over, for the Star Wolf Playermodel (He’s our Valve Skeleton, so it’s compatible with the model.)
So now you should have two folders, filled with stuff. Open the «Ragdoll_Decompiled», and open the «models» folder, follow the root all the way to «humans/nypd/.» Today, we’re just going to do «male_01.» Open Crowbar, and go to the «Decompile» Tab. You should see this.
Click on «Browse», and find the «Ragdoll_Decompiled» folder, go all the way down in the «models» folder, till you find «male_01.mdl», then «Open» him. Now go to the «Subfolder (of MDL file or folder.)» (It’s right below our main line where we got «male_01.mdl», and name it, «Male01_Decompiled», it’s important. (Do NOT add spaces, ONLY add «_» underscores, if you want to «space.»)
Now hit «Decompile.» If you got an error, you probably did something wrong; Re-do the tutorial, or Copy and Paste your Log and put it in the Comments. (Help each other out, or I’ll reply to it.)
If you open the «Male01_Decompiled» folder, you’ll see a lot of stuff. Most importantly, you’ll see the SMD files. You ONLY need to worry about the «male_01_reference.smd» for now.
Do all of the above for the «Skeleton.» (Make sure you Decompile it into a custom Skeleton folder, and not the «Ragdoll_Decompiled» one.)
Alright, we’re ready to enter Blender; Delete everything in the Scene.
Now, we’ve got to install the Source Addon, go to «File», then «User Preferences», then click on the «Add-ons» Tab. Click on «Install from File», and direct to your «Downloads» folder, and it should be there. (I forgot to mention; Make sure it’s un-zipped, if you can’t do that, get a program like WinRar, or 7-Zip.) Now, we’ve got to check the «Import-Export: Blender Source Tools.»
Now, we’ve got to import our Mesh; To do so, «File > Import > Source Engine», then go to our folder, «Ragdoll_Decompiled», and go down until you find, «Male01_Decompiled.» We have to open, «male_01_reference.smd.» We now have our Mesh in Blender. We have to remove his bone-set, as it won’t be compatible with Garry’s Mod.
Once you’ve deleted those bones, we have to import our Skeleton.
«File > Import > Source Engine», and find your Skeleton_Decompiled, and import, «starwolf_reference_reference.smd.» Delete the Star Wolf Mesh.
If you’ve done everything correctly; You’ll have this;
Now we’ve got to allign all of the bones to the mesh, and this is an important step; If you mess it up, nothing will work. Don’t delete any bones, or else you’ll have to remove the code in the QC File! (I won’t be showing you how to do that in this Tutorial, but I’ll show basic QC, as you need to do that for our playermodel to work.)
Once you’re done rigging; It should look like this (I ended up deleting my fingers, because they take too long, but I’d recommend you keep your fingers for an actual playermodel; They’re important.):
Yours may not be in Wireframe, but I personally like to work in Wireframe mode.
Now we have to go to Object Mode, Select the Mesh, and Shift Right-Click the Skeleton.
Hit «CTRL + P» and «with Automatic Weights.»
Congratulations, you’ve successfully rigged; Now you’ve got to Weight Paint. (I won’t be explaining it, it’s way to long to explain; It’s very important though.) WEIGHT PAINTING IS INCREDIBLY IMPORTANT; IF NOT DONE, AN ARM WILL MOVE IT’S HEAD.
Now, we have to Export it; Go to the tab with the cylinder, scroll down; You’ll find «Export», set it to «SMD», and set your Export Path, then Export! (Do it in the Documents folder.)
It’ll look like this;
Open your, «Tutorial_PM» folder (The one with, «lua», «materials», and «models»), open the «materials» folder, make a new folder called, «models», then your username, for me it’s; «panda» (Don’t add any capitals to the folders.), then add a folder inside, «panda», and name it, «male01», then your textures folder is setup.
If you’ve done everything correctly; You should have this:
Congratulations; You now have textures for your Playermodel.
The QC File is all the back-end code for your playermodel(s). If ANYTHING is done incorrectly, or misspelt, NOTHING will work.
Open your «Skeleton» folder, and get to the, «Skeleton_Decompiled» folder. (models/player/qgon3/starwolf/Skeleton_Decompiled/) Delete the «starwolf_reference_reference.smd» file, and put in our, «male_01_reference.smd» file. (We exported it to our Documents folder.) Now, rename the, «starwolf_reference_physics.smd» to, «male01_reference_physics.smd», rename the QC file to, «male01_reference.qc», and finally, our animations folder; Rename that to, «male01_reference_anims», Basically rename everything to «male01» instead of «starwolf.»
Make it look like this:
Now, let’s open our «.qc» file; Right-Click it, and «Open with..», and find «Sublime Text», or, «Notepad++», which ever you downloaded. (Again, I’m using Sublime Text for this tutorial, but they both work.)
You’re going to see;
Change our «ModelName» to «male01_pm.mdl»
Change our «BodyGroup» to «male01»
Change our «Studio» to «male_01_reference.smd» (If you spell this wrong, nothing will work.)
Now, time to tell the computer where our textures are, instead of «models\brawl\wolf\», change it to, «models/panda/male01/» (Or whatever your name is; Let’s say it’s username123; It’d be «models/username123/male01/», or whatever.)
Now, we’ve got to edit the animations, and physics. If you scroll down a little, you’ll see
Change the «Sequence «ragdoll» where it says, «starwolf_reference_anims\ragdoll.smd» to, «male01_reference_anims/ragdoll.smd» (Again, if this isn’t spelt correctly, nothing will work.)
Change the, «CollisionJoints «starwolf_reference_physics.smd» to, «male01_reference_physics.smd» (Once Again, if this isn’t spelt correctly, nothing will work.)
Now, you’re going to see
in the middle of all of that code above; If your playermodel is a female; Keep it «f_anm.mdl», if not, change it to, «m_anm.mdl», and you’re set.
Now, we’d be removing bones and such; If you removed bones from the rig, but I only removed the fingers; I already removed those from the QC, so if you don’t delete anything, you should be set for QC, and if you deleted bones; You have to remove the code of those bones in the QC. (I won’t be explaining that in this tutorial, so I said above; «I don’t advise deleting bones.»)
I would also be showing you how to setup, «c_arms», which are the Custom Arms that the player sees when he/she holds a weapon, but I won’t do that in this tutorial. (Such as the Gravity Gun; You’d see the playermodel’s arms, instead of Garry’s Mod default one(s).)
Make sure your Crowbar is set to (De)Compile in «Garry’s Mod», and make sure you have Source SDK 2013 Multiplayer on the same Drive. (If GMod is on your C:\ drive, so does Source SDK 2013: MP.) You also need Half-Life: 2.
Open Crowbar, go to the «Compile» tab; You’ll see «QC file or folder.», click «Browse», go to your «Skeleton_Decompiled» folder, where your QC rests, and select that. For the «Subfolder», name it, «male01_compiled.» Like so:
Then hit, «Compile.» Make sure you scroll up and check for errors; If you got any, post it in the Comments, and help each other out. (I’ll reply to some too.)
Now that everything’s out of the way, it should look like this:
We’re now on the final steps of this tutorial.
We’re now on the final step of making our model, after that; We’re done, and can test it in-game!
Now, you’ve just to find our «models» folder full directory, it’s in the folder where this lua folder is; My directory would be, «models/player/panda/male01/male01_pm.mdl», so I’m going to put it in there.
For our, «ModelName», it’s going to just be, «Male01»; Here’s an example of mine:
«Male01» is the name that’ll show up in the «Player Menu», when you hover over it. We’re now done with our Playermodel; We can now put it in our addons folder! (If you’re not sure how to do that; Why’re you here?)
Congratulations if you’ve made it this far. Making playermodels aren’t easy, but it’s a lot easier making them from Ragdolls. (Which is why I made a tutorial, using this method; So people who actually want to invest into it (Who’re beginners.), and not for little kids who want to become famous making half-baked models.)
I make them from base models; It’s frusterating, and a tedious process. It takes a lot of time and practice to get efficient with it. I’ll probably end up making another guide for Non-Source models, and even Making Custom ones from Scratch, also a seperate Guide for «c_arms», it’s not difficult, I just don’t want it in this Guide.
Physics and Ragdolls
Contents
Creating physboxes
Build a collision model
Each separate object is converted into a convex hull. So you should have all faces that belong to a single convex object be a single smoothing group & texture. Also, it uses simple vertex connectivity to determine what an object is, so don’t connect things you don’t want turned into a single convex hull. Studiomdl does not optimize any of the meshes, it just makes convex hulls.
As a rule of thumb, you shouldn’t model anything smaller than 1″ cubed as a detail. You should be somewhat coarse in that regard, all details like bolts, buttons, etc should not be modeled as separate convex pieces.
$autocenter moves the model so that its origin is at the center of its bounding box.
It also adds an attachment point called «placementOrigin» which is the offset to the original origin.
Useful Commands
Making a Ragdoll
Build a Collision Model
Using one of the existing characters as a guideline, build a set of separate objects (one for each bone). Make these objects as simple as possible, but don’t compromise the shape of the character too much. Keep in mind that the physics system is going to make each bone a convex object. It is not currently possible to make concave objects without using multiple bones. These models should be fairly low poly in general, and each vertex should be assigned to a single bone. It’s ok to leave holes in the skin (again, see one of the existing models like combine soldier or zombie).
You should only add collision objects for some of the bones in this model. If you put too many, you are just creating more work for someone else later. Performance limitations mean that we can only simulate somewhere between 15-20 bones per character and still hit our budgets. On bipeds, use an existing model as a template. In HL2, we’ve cut down bipeds for simulation as follows:
The end result is about 15 bones for most human characters.
Build the Ragdoll Pose
Pose the model in its most relaxed state. This pose will play the animation for each bone that isn’t being simulated. With humans, we’ve eliminated the fingers, so it’s essential that you pose the fingers in this animation. That way, if a character dies while holding a gun, he won’t fall over with his trigger finger out.
Add the ragdoll.qc File
Build the Model
Run studiomdl on the model. It should tell you that it’s building a jointed collision model.
Run HLMV and Edit the Joints
Now run HLMV. First, check the Physics Model checkbox. Check over the wireframe physics model to make sure it built correctly and that your vertex assignments are ok. Click the physics tab. Now you can go through each axis of each joint and set the joint limits. Again, if you copy the qc file from another character, you can start with its joint limits. Be sure to set the mass to something appropriate (in kilograms). 1 kilogram is 2.2 pounds.
hairibar/Hairibar.Ragdoll
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
A Unity package for making ragdolls and animating them with keyframed animations. See it in action at https://youtu.be/ByNPbbACf40.
Table of Contents
Hairibar.Ragdoll works by keeping two versions of the character’s bone hierarchy. The Target, which is animated by Unity and has a mesh, and the Ragdoll, which has no visual representation.
Every physics step, appropriate forces are applied to the Ragdoll so that it follows the Target animation (this is referred to as Animation Matching). Every frame, just before rendering, the Target bones are moved to the pose of the Ragdoll bones, effectively rendering the Ragdoll.
This approach makes it easy to add ragdoll effects, as no changes to the existing hierarchy are needed. The ragdoll effect works like a post-processing effect applied to the animation.
Position and Rotation Matching
The Target position and rotation are matched separately. Position and rotation matching can be configured/enabled/disabled independently. Position is matched in world-space, while rotation is matched in the local space of each bone.
Matching position in world space makes Ragdoll bones easily line up with the Target bones.
Matching rotation in local space allows the Ragdoll to attempt to match the Target pose, but allows this pose to be deformed by forces, collisions etc.
A RagdollDefinition keeps a list of the bones present in a ragdoll.
http://sergioabreu-g.medium.com/how-to-make-active-ragdolls-in-unity-35347dcb952d