Self Balanced Active Ragdolls In Unity

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
ragdoll physics are becoming very popular in video games because of their ability to make character interactions feel more lifelike they allow characters bodies to react dynamically to forces and impacts making the game feel more realistic and immersive and also just feels funner to play with however most games that use ragdoll physics only use them to replace death animations this is because ragdolls are very good at falling down but that's about all they can do on their own so how do we get rhaegars to balance so that we can use them in our games other than just for Dead characters well most games that use active rag dolls just apply an upward Force to the head or fix the rotation of the hips so that's impossible for the character to fall down some games that do this are human fall flat Gang Beasts and tabs as you can see in these games the hips don't move the problem with this approach is that the player can tell that there are external forces being used to balance the Ragdoll and it just breaks the immersion so the solution to this problem is self-balanced active rag dolls metalcore 999s active ragdollars balance themselves by placing their feet where they need to step to balance their body they also use some external forces to keep the hips upright but it's not very noticeable and it looks like they're bouncing on their own here's another example of a ragdoll balancing itself this one uses inverse kinematics to position the feet and this is the approach that I'm going to be going with the most difficult part of this is figuring out when and where the feet should step what I did was when the foot was too far from the body it would take a step and stop both feet from stepping at the same time I added a pause between steps this made the character just take two steps at a time and it looked really weird then in my procedural animation video I discovered that it looks good if I wait for both feet to be too far from the body and then the furthest one behind takes a step then instead of stepping directly below the body I made it overshoot the body in the direction that it's moving it took me a while to get this working in 3D but when I did this is what it looked like I also lurped the foot's position and added a point in the middle of the step where the foot leaves the ground so that it doesn't just look like it's sliding his feet across the floor and he's actually like taking a step off the ground okay now it's time to add physics so that I can actually interact with the environment and be an actual Act of ragdoll however since the legs don't have any actual strength the body just falls to the ground when you add physics in Danny's game Milkman Carlson if you look closely you'll see that Carlson's body actually lifts itself up but it gives the illusion of the legs actually having strength so I shot a raycast below the body and then made the body float above that point using physical forces and now can walk up and down slopes then to improve its balance I added a weak torque to the hip so that it wouldn't fall over so easily but if the hips get too unbalanced I disable all the scripts and it rake dolls this is the final result and I'm pretty satisfied with it it's really fun to play around with and I think it looks really good and as you can see I added some boxes that you can throw and you can also like grab things and pull them and it just makes it really fun to play with and it's really cool and you can just like mess around with all the different ragdolls and I made a basic NPC script which makes the ragdolls walk towards the Target and so this Ragdoll walks towards me and that other rag doll walks towards this Ragdoll and then this Ragdoll walks towards this Cube and you can move it and it'll follow the cube to make it easier to set up the active Ragdoll on another character I made my first editor script and all I have to do now is put in a few bones and then it'll automatically generate the inverse kinematics and all the scripts and stuff so that it can balance by itself and so now I can just get a new Ragdoll in my project and I can just add the script and then like in a few minutes it's bouncing all by itself anyways imma just keep showing some clips of me like playing around with the ragdolls but if you want to play around with it I uploaded it to hio so you can check the description for the link and then you can just download it yourself and mess around with it also if you want a more in-depth uh technical video about this just tell me in the comments and if people actually want me to make that I'll make the video and just make sure you're subscribed so that you can see that but yeah if you made it this far in the video thank you so much for watching I'd really appreciate if you leave a like so that more people can see the video but yeah um I'll see you next time
Info
Channel: Drollest Prawn
Views: 9,495
Rating: undefined out of 5
Keywords: unity, game, dev, indie, gamedev, development, Unity 3d, ragdoll, balance, 3D, 3d, Active, Active Ragdoll, Funny, Grab, Human Fall Flat, Inverse kinematics, Physics, Physics Based, Ragdoll, Unity, Unity 3D, active, active ragdoll, ai, animate, animation, based, code, coding, cool, dani, grabbing, how to, ik, inverse kinematics, joint, karlson, milkman, physics, physics animation, physics based, player, self, self balance, stand, stand up, strait, tutorial, unity 3d, unity tutorial, unity3d, up, walk
Id: p0X5HleoHDU
Channel Id: undefined
Length: 5min 54sec (354 seconds)
Published: Tue Aug 22 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.