Ragdolls - Creation, Transitioning to, and Optimization | Unity Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ม.ค. 2025

ความคิดเห็น • 55

  • @jackz4665
    @jackz4665 2 ปีที่แล้ว +6

    Hi if I leave the Animator On the collisions with the ragdoll colliders don't work well, they are very buggy... do you know how to fix this problem and use the same colliders in order to shoot and kill the zombie while the animator is On?

    • @LlamAcademy
      @LlamAcademy  2 ปีที่แล้ว +1

      Can you help me understand what "buggy" means? I did not have challenges with the colliders as long as they did not intersect

    • @jackz4665
      @jackz4665 2 ปีที่แล้ว +3

      @@LlamAcademy i fixed the problem.. you gotta make the whole rigidbody as kinematic, otherwise it will bug during animations and in the physics debug view you can see what I mean, just let the zombie play the run_in_place animations and you'll see the rigidbody will start flickering and teleporting if it's not fully kinematic or instead you can remove character joints but then they need to be recreated in the ragdoll

    • @LlamAcademy
      @LlamAcademy  2 ปีที่แล้ว +5

      Hmm yes that is a good point. I thought I mentioned that in the video but I don’t see it there. They should be kinematic to prevent that kind of an issue. Maybe it was in the AI Series where I did ragdoll AI I talked about that. I will pin this so it is easy to find for others. Glad you figured it out!

  • @AlexGorskov
    @AlexGorskov 2 หลายเดือนก่อน

    This if my favourite Unity tutorial channel. The voice, the vibe, the detailed approach (when needed) - it's perfect. Thanks dude! May your channel prosper!

  • @audemkay
    @audemkay 2 ปีที่แล้ว +4

    This is the best ragdoll tutorial I've seen. I've never been fully satisfied with my previous implementations. Thanks for the great video!

  • @TimeFlierGames
    @TimeFlierGames 2 ปีที่แล้ว +3

    No way! I just started using your videos a couple days ago to help with my new VR zombie game (demo on my channel) and we're using the same free asset :)
    finally a replacement for Brackey's, thanks for your help!

  • @ronigleydsonvilasnovas8067
    @ronigleydsonvilasnovas8067 2 ปีที่แล้ว +3

    I needed a Ragdoll tutorial like this, one with all its special tips that make all the difference

    • @LlamAcademy
      @LlamAcademy  2 ปีที่แล้ว +1

      Thanks🙏! This was a feature I wanted to add to Llama Survival but ended up skipping on at the time because the ragdoll creation process was too time consuming and the performance wasn't great. After monkeying with this to optimize those two trouble spots, it might finally see the light of day! (or the dark of night since it's zombies?)

    • @ronigleydsonvilasnovas8067
      @ronigleydsonvilasnovas8067 2 ปีที่แล้ว

      zombies are always fun, if they're in large numbers it's even better😁. I really appreciate all your work to help us solve these problems🙏.

  • @CleanDay420
    @CleanDay420 ปีที่แล้ว +2

    Truly a fantastic tutorial. Thank you for concise, fast, clean, and accurate information. Subbed and will be watching all your other videos :D

  • @realinfinux
    @realinfinux ปีที่แล้ว +1

    Awesome tutorial man, love your energy & explanation style :]

    • @LlamAcademy
      @LlamAcademy  ปีที่แล้ว

      🧡 thank you for that!

  • @Ignaciodev
    @Ignaciodev 3 หลายเดือนก่อน +1

    This video was absolutely great, thank you so much!!

  • @regys9521
    @regys9521 ปีที่แล้ว +1

    What a video, this makes everything clear AF!

  • @HighAFelf
    @HighAFelf ปีที่แล้ว +3

    If your character's joints are stretching and moving in odd ways when being animated, make sure to set every rigid body to kinematic and then set kinematic to false when going into ragdoll

  • @a.technology1446
    @a.technology1446 2 ปีที่แล้ว +1

    i really enjoyed with ur videos , thank u

  • @richardbeare11
    @richardbeare11 2 ปีที่แล้ว +1

    Nice! Very helpful

    • @LlamAcademy
      @LlamAcademy  2 ปีที่แล้ว

      Glad it helped! 🙌

    • @richardbeare11
      @richardbeare11 2 ปีที่แล้ว

      @@LlamAcademy yep, check out the result 🤣
      th-cam.com/video/WGyJScrVxh0/w-d-xo.html

  • @goehlergamedev
    @goehlergamedev 11 หลายเดือนก่อน +1

    You can fix the head by manually adding a neck joint between the torso and the head. 😊

    • @LlamAcademy
      @LlamAcademy  11 หลายเดือนก่อน

      Good idea!

  • @muhammedakbey5328
    @muhammedakbey5328 2 ปีที่แล้ว +1

    helpfully, thx bro 👍

  • @alperaydin7011
    @alperaydin7011 2 ปีที่แล้ว +1

    Thanks

    • @LlamAcademy
      @LlamAcademy  2 ปีที่แล้ว

      You’re welcome 🙌

  • @ashb899
    @ashb899 ปีที่แล้ว +1

    good video!

  • @hugodanielvalladoliddaumas7073
    @hugodanielvalladoliddaumas7073 9 หลายเดือนก่อน

    Hi Liam,, if im using unity's build up character controller, how can I dissable and enable ragdolls?

  • @worldkho
    @worldkho 10 หลายเดือนก่อน

    thank you!

  • @McGeezle
    @McGeezle 10 หลายเดือนก่อน

    Is it possible to add ragdoll (just on death) to enemies in existing unity games (Turbo Overkill)?

  • @EliasArnn
    @EliasArnn ปีที่แล้ว

    How would i ragdoll only the legs but not the upper body?

  • @TwoFahOfficial
    @TwoFahOfficial 6 หลายเดือนก่อน

    When I activates the animator again mai character was teleported to old position

  • @KonradGM
    @KonradGM 2 ปีที่แล้ว

    ... how did you made the 3 buttons at top left xD ? i often see unity debug buttons with this graphic but i was never able to find how to make those

    • @LlamAcademy
      @LlamAcademy  2 ปีที่แล้ว +1

      This is done by just having the OnGUI callback defined on a MonoBehaviour and using the IMGUI system like GUI.Button and GUI.Label

  • @OndrejL
    @OndrejL 2 ปีที่แล้ว +1

    as the saying goes: the devil is in the details. and those cruicial details presented here are missing in most of the other tutorials ive seen. thx chief

    • @LlamAcademy
      @LlamAcademy  2 ปีที่แล้ว

      🙏thank you for that!

  • @Dehakuzo
    @Dehakuzo 2 ปีที่แล้ว +4

    Any tips for the ragdoll>animator transition? Specifically with getting the positions lined up, and maybe even smoothening the transition so it doesn't snap.
    For the positions... The ragdoll doesn't carry the game objects position, so if it gets blown away 10 meters, and then the animator is turned back on, it snaps back into it's original position, instead of it's new position.
    As for the smoothing... Yeah, it's an instant snap, any ideas on how to transition from ragdoll to animator smoothly?

    • @LlamAcademy
      @LlamAcademy  2 ปีที่แล้ว

      Those are great questions - I hadn't considered those in the scope of this video because I was thinking of the use cases for Animated model dies -> goes into Ragdoll mode and eventually fades out or is removed. Going the other way is significantly more tricky because as you've said, we have to:
      1. Move the GameObject position to the ragdoll's current position
      2. probably do some procedural animation to move the limbs back to the starting pose of your target animation
      3. Finally re-enable the Animator.
      I'll give this some more thought and see if I can't come up with a reasonable way to do those steps.

    • @Dehakuzo
      @Dehakuzo 2 ปีที่แล้ว

      @@LlamAcademy Yeah, this use case is more for knock down attacks rather than final blows. Some great tips.
      I would love to see your take on this situation! Especially on point 2.

    • @ThatRazzy
      @ThatRazzy 2 ปีที่แล้ว +1

      @@LlamAcademy It's surprising how little information there is on how to do this effectively. I'd love to see a tutorial on it 😃

    • @elfarostudios
      @elfarostudios 2 ปีที่แล้ว +3

      the simplest way i can come up with on the fly is, have, let's say, two animations standing up, one facing up, another facing down. Store the transform of each bodypart of the first frame of each animation beforehand. On runtime, check, by the torso or face, which animation starting point is closer to the current state of the ragdoll. Then, diable the ragdoll and start transitioning each limb or body part to it's target position/rotation (the first frame of animation). Finally, activate the animator and trigger the correct standing up animation. Hope it helps.

    • @ThatRazzy
      @ThatRazzy 2 ปีที่แล้ว

      @@elfarostudios Hey, thank you for the detailed reply! This is actually more or less the approach I've been using. However, as an inexperienced programmer, I am worried my code is not particularly efficient at the moment, and there are other issues I'm struggling to wrap my head around. I am using a coroutine in the start method to play the animations for getting up and capturing the transforms of all the bones (This is on an AI so there are various components that have to be deactivated and reactivated during this process).
      Then, when the character gets knocked over there is another coroutine which first initiates the ragdoll (and deactivates the animator/other components), waits some time for it to stay in that mode, then makes all the bones' rigidbodies kinematic again and activates a bool for lerping all the bones from their current position (which happens in the update method). After a certain period of time, when that lerp is done, the coroutine makes that bool false to stop the lerping, activating the animator and playing the animation for getting up (I only have one animation to test at the moment). It times the length of the getting up animation and then reactivates all the necessary AI components when done so it can resume its behaviour.
      There are a few issues with this approach. The outcome isn't as smooth as I would like, and it feels like quite a messy way to go about doing this. I'm concerned that there is a more efficient way.

  • @webbtechsweden
    @webbtechsweden 2 ปีที่แล้ว

    Thanks for a great tutorial!
    There were some things that were hard to follow. Can't really see what you did. After dragging the Human Pelvis to the Ragdoll Root of the Enabler Script here th-cam.com/video/RB18IyKZiB0/w-d-xo.html, how did you open the Runtime GUI in the inspector? I mean do you have to add the GUI to a game object? Which one?

    • @LlamAcademy
      @LlamAcademy  2 ปีที่แล้ว

      Hi! To edit the constraints of the joint, at the very top of the CharacterJoint component in the inspector there's a little edit icon titled "Edit Angular Limits" if you click on that then you can modify them with that GUI you saw in this video!

  • @KonradGM
    @KonradGM ปีที่แล้ว

    I got curious ,is it possible to blend between Animation and ragdoll? By certain interpolation maybe mixed with weight strength for animation?

    • @LlamAcademy
      @LlamAcademy  ปีที่แล้ว

      @KetraGames (www.youtube.com/@KetraGames ) has a really cool tutorial on getting up from a ragdoll state. I think it includes some blending!

  • @milizfs
    @milizfs ปีที่แล้ว

    there is a problem now the ragdoll enabler doesnt exist

    • @LlamAcademy
      @LlamAcademy  ปีที่แล้ว

      I created the Ragdoll Enabler script for this demo. It is included in the github repository for this video. Link is in description!

  • @pianosouls_yt
    @pianosouls_yt 2 ปีที่แล้ว

    i meet a bug if i scale up or scale like (-1,1,1) ragdoll in runtime :v could you fix it

  • @WallStreetCroaker
    @WallStreetCroaker 3 หลายเดือนก่อน

    17:09 : "taking 10 ms isn't outrageous" LOL
    10ms translates as roughly 100 FPS
    This is actually pretty outrageous, how can you make a game when 75% of your frame time budget goes into physics? You turn OFF the camera and render nothing? XD
    Your target budget should be max 15 ms/frame

    • @LlamAcademy
      @LlamAcademy  3 หลายเดือนก่อน

      Yes. Roughly 100FPS for dozens of ragdoll zombies all active is pretty good using the built in Animator performing only minimal "do less processing" physics optimization. Is there room for improvement? Always 😉. Cheers.

  • @TYNEPUNK
    @TYNEPUNK 2 ปีที่แล้ว

    Thanks but you dont cover going from ragdoll to animator again smoothly, that would be very cool.

    • @LlamAcademy
      @LlamAcademy  2 ปีที่แล้ว +2

      KetraGames recently covered that in a really cool way: th-cam.com/video/B_NnQQKiw6I/w-d-xo.html
      I hope that one can help you

  • @gamedevbhartiya
    @gamedevbhartiya ปีที่แล้ว

    Bekar