hey can i use the GitHub and your model and build on to it because i want to build a game for my friends and me and maybe eventually release it i know its a lot to ask but I'm still learning so this will probably be temporary
I was trying to mix procedural animations with ragdolls achieving "okayish to meh" results, but what I really wanted was a ragdoll that would try and replicate an keyframed animation. Could't find much help until I found your project. Really helpful man, thumbs up, mucho gusto, gracias
Incredibly useful, thank you so much! I'm glad I'm not the only one who is fiercely interested in this topic, we could really use more content like this.
this helped so much for the project im working on at school, didnt even have to check the project! i feel like i understand both rigging and ragdolls in the unity context much better now :)
wow thank you. was lost on the direction i needed to go for my project but this looks to be exactly what i need. thank you for all your hard work on this subject and the great resources you've provided.
Fantastic! What you have done here is truly breathtaking. As it is, it is not practical to be used in a game as this project alone running on my machine with an AMD Ryzen 7 3700x 8 core and NVdia Geforce GTX1650 gave a frame rate of around 250 -280 (moving about) in the editor with the screen maximized. It will definitely increase in a build. What can be done to increase the frame rate? The physics system will need to be polished up right? Amazing results you have here. Going to watch your progress. Couldn't find you on Patreon to support.
Thank you so much! I haven't tested this project's performance, to be honest, but it could be optimized to make a better use of the CPU's multithreading, which should give it a slight boost in fps. I'm not on Patreon since I don't upload videos regularly. I might start creating content more seriously in the near future though, but it won't be related to this.
Here's how I did the scene setup: The player has 2 avatars with the rigs and skinned meshes. For the animator avatar, just remove the material from the skinned mesh renderer. Go to GameObject - 3d object - ragdoll and then drag in all the corrosponding rig children. I didn't have exact matches for some things, so I just did the closest I had to it, for instance the hips as pelvis. Adjust the colliders a bit after you press create ragdoll.
My code is almost identical to yours when it comes to setting the target rotation but for some reason the configurable joints extensions tells me for some of my joints that the look rotation vector is zero and i dont know what to do since its not even a real error but a print log. Could it be that since the joints axis arent always set to all directions that the joint.axis part returns zero and therefore also returns as a Vector3.zero?
That print log appears when you try to create a Quaternion from a Vector3.zero, so I guess it's happening to you at the fourth line of SetTargetRotationInternal(...) method of the ConfigurableJointExtensions. It may very well be because your joints' axes are not configured properly. You have to set both 'Axis' and 'Secondary Axis' to two different unit vectors, for example: Axis = 0, 1, 0 Secondary Axis = 1, 0, 0 How to choose those vectors depends on your model's internal rotations, so I can't help you more there.
You're absolutely right. That's one of the things I would like to change about this video now. When I wrote that, I was thinking not about my active ragdoll project, but about more advanced systems which use machine learning to blend animations with physics. I didn't explain that very well. Here's an example of what I'm talking about: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-JZKaqQKcAnw.html Anyway, the definition of AI is very flexible, since we can't define what intelligence is. There's a lot of debate on what is and isn't AI, the boundaries are constantly being pushed farther away. There are a lot of algorithms that were considered AI in the past but now are just normal algorithms.
i’m not sure if it’s a bug or not but when i don’t have is kinematic enabled on my characters colliders or rigidbodies i can’t rmb which it is. They are really bad at detecting being hit by ray casts and can almost be random entirely whether they register or not.
Yes, when physics were not configured correctly things like those used to happen a lot. But they should not be happening in the version that's on Github.
Not sure what you mean by separate body parts. If you mean they are not connected to the main body, I can't really tell since I haven't tried it myself. I guess it can work as long as you set up the rigidbodies and joints correctly.
Like, the body parts are separate objects. Another thing, when ever I try to rig it, the mesh starts to freak out, do you have an idea on what's going wrong?
@@gr4babeam It's hard to tell mate :S. You can download my github repository and check the differences with your project, maybe you'll find what's wrong.
Hahah true. Lowering the physics time step is necessary to achieve a better simulation and avoid problems like that weird foot. I just didn't realize it when I made this video/project hehe
are you doing ik with the active rag doll arms? i’ve made the setup you detail with a pair of arms, where the active rag doll arms follow ik arms (animation rigging). but i also need to secure the hand bone of the physics based arms to a fixed position (a wall). however if i just try to have it follow the ik arms when they are secured to the wall, the hand bone is loose and moves around a lot testing out your unity project though, it looks like your arms are locked onto the object that they are grabbing. trying to figure out how to emulate that
I don't lock the IK arms to the object, but instead link the physics based arms and the object through a Fixed Joint. The IK arms are still free that way, which allows the character to move the object or to push/pull itself by grabbing something unmovable such as a wall.
@@sergioabreu-g i see, thanks for the response. i tried using fixed joints as well but was still getting a lot of movement for the hand bone compared to the animated version. maybe just have to play with it more
You can download the whole project here and see how I did everything: github.com/sergioabreu-g/active-ragdolls There's a CameraModule script with the camera behaviour.
Great video you have out together Sergio. I have also been following this topic of Active Ragdoll physics for a couple of years now and you have summarised the subject wonderfully.
Ohhhh so your the guy who made this nice physics animation package. Nice to see how these packages were made while I’m just downloading it and trying to understand it lol.
i remember dan a guy caled Happy Chuck or something do a video showing up the same thing than you do in this video, but hold up, this is an amazing video, and i love it, a really good video, good job :D
Can you please make an in-depth tutorial on how to actually apply this to your character? This tutorial is good, don't get me wrong, but starting from scratch and showing us your progress from there really helps :)
I don't intend to make another tutorial. This isn't really a tutorial actually, just a video showing some interesting stuff hahah I wrote something more of a tutorial here that you might find useful: sergioabreu-g.medium.com/how-to-make-active-ragdolls-in-unity-35347dcb952d
If you mean that this will increase the response time of the player input, yeah it might increase it a few miliseconds. But I don't think it matters, since physics-based animations are not instantaneous. When you move a simulated body, it takes it some time to start moving due to acceleration. The increase in response time is much shorter in comparison, so it really makes not difference in my opinion. Thank you for your question!
@@sergioabreu-g > physics-based animations are not instantaneous ah... doesn't have to always be like that... A keyframe animation moves objA from locA to locB for example. methodA - start dragging our body after animation system kicks in : When objA is at lerp(locA, locB, .5f), objB is maybe around lerp(locA, locB, .49f). Sometimes the character looks like it's dragging its body, cus it's always behind the schedule. methodB - start dragging our body before animation system kicks in : Assuming objA and objB aren't too far away from each other & our "muscle/motor" is powerful enough to cover the difference in distance. Well, since we know where our future objA is, we can drag objB to that location on time. methodB
It depends, if you want a realistic jump, you'd have to make a jump animation so that it's able to propel itself with its own strength, but that would be very hard to get right. I would add an external upwards force that helps it jump without having to rely so much on limb strength and contact with the ground.
It's just a simple character made of cubes with a standard rig attached to it. There are tons of tutorials on RU-vid much better than what I could make 😂