Search Unity

How to make an active ragdoll character?

Discussion in 'Physics' started by AnipGames, Apr 25, 2020.

  1. AnipGames

    AnipGames

    Joined:
    Nov 27, 2018
    Posts:
    34
    Hello Unity World!
    How would I create an active ragdoll player that can climb things and grab objects? Kinda like the human fall flat character. I googled this but found nothing that worked. How would I go about creating this character?
    Thanks!
     
  2. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    868
    Hey, this very much depends on your use case. Is this for VR? All I can say now is that there is no easy way. You need a very detailed understanding of physics in unity to get it right, especially collider, rigid bodies and configurable joints, maybe you also need to combine IK and/or animations with physics.
     
  3. AnipGames

    AnipGames

    Joined:
    Nov 27, 2018
    Posts:
    34
    Hi Qleenie, thanks for your reply!
    I am using this for a third person obstacle course game. I also have a pretty good understanding of physics in unity, but not the best understanding of scripting and animation. Would I have to combine animations with physics, or make the character entirely physics-based?
    Thanks!
     
  4. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    868
    I guess combination with animation is easier, but by far not easy. There are assets to achieve this, e.g. Puppet Master on asset store. I baked an own solution for my purposes, which uses drives on Joints to follow some animation, but it was a lot of try and error to get it right.
     
  5. AnipGames

    AnipGames

    Joined:
    Nov 27, 2018
    Posts:
    34
    Hello,
    Thanks for the recommendation, I'll use animation and I'll check out that asset.
    Thanks so much!
     
  6. AnipGames

    AnipGames

    Joined:
    Nov 27, 2018
    Posts:
    34
    Hello!
    I'm not sure if this is still active, but I was curious how I would get my character to be able to climb a wall. Should I make a spring joint attached to the wall and hands?
    Thanks
     
  7. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    868
    I never tried this, but sounds like a plan. Not sure if you can configure a breaking force, which probably would be good to have (fixed joint has this; means joint will get destroyed if a certain force is applied).
     
  8. AnipGames

    AnipGames

    Joined:
    Nov 27, 2018
    Posts:
    34
    Hmm, I never thought of a fixed joint, that's a really good idea. Thanks
     
  9. marscratcher

    marscratcher

    Joined:
    Mar 27, 2020
    Posts:
    6
    Could you have a fixed joint attached to an empty game object attached to a spring joint? That way, you would still get breaking, but also springiness.
     
  10. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    868
    Just checked; also Spring joints has break force property, so you can use spring joint also, if you need spring behavior
     
  11. marscratcher

    marscratcher

    Joined:
    Mar 27, 2020
    Posts:
    6
    Ok good to know. I am doing something similar, but with zero gravity.
     
  12. AnipGames

    AnipGames

    Joined:
    Nov 27, 2018
    Posts:
    34
    cool idea.
    Good luck with your project!
     
  13. marscratcher

    marscratcher

    Joined:
    Mar 27, 2020
    Posts:
    6
    Thanks, I'm glad my idea sounds promising.
     
  14. AnipGames

    AnipGames

    Joined:
    Nov 27, 2018
    Posts:
    34
    If you ever want feedback on your project, feel free to share me what you have so far and I can test it out for you and tell you about any bugs or changes.
     
  15. marscratcher

    marscratcher

    Joined:
    Mar 27, 2020
    Posts:
    6
    Well, how much experience do you have with indoor lighting? I am trying to make it look like the light is coming from these light bars, but everything I do either doesn't cast light on the player or makes everything but the player too bright. Also, the lightmap generates some sections darker (separate gameobjects) even though they had the same materials.
     

    Attached Files:

  16. AnipGames

    AnipGames

    Joined:
    Nov 27, 2018
    Posts:
    34
    You could try convert the material to PBR (physically based rendering) and use emmisive lighting and turn up the brightness of the emmisive light, or you could use Aura (on the asset store, I believe they have shaped lighting. I hope that helps!
     
  17. marscratcher

    marscratcher

    Joined:
    Mar 27, 2020
    Posts:
    6
    Thanks, Ill try that.
     
  18. AnipGames

    AnipGames

    Joined:
    Nov 27, 2018
    Posts:
    34
    No problem
     
  19. AnipGames

    AnipGames

    Joined:
    Nov 27, 2018
    Posts:
    34
    Hello,
    I was wondering what I could do to make my physics less jumpy and more stable. Sometimes my character randomly goes flying hundreds of thousands of units away, other times it starts flailing about. What can I do to fix this? It's driving me crazy!
     
  20. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I'd just buy puppetmaster and be done with it, frankly.
     
    Qleenie likes this.
  21. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    868
    I would second this recommendation; unless you want to deal with this yourself and get a VERY deep understanding of physics in Unity. But this will take some months, as you'll reach a point where the documentation won't help you anymore. I was able to get it right in my project, but I also started with Puppet Master first, which is a great asset.
     
  22. AnipGames

    AnipGames

    Joined:
    Nov 27, 2018
    Posts:
    34
    Hmm, that sound really good. I'll try it out this afternoon.
    Thanks!
     
  23. AnipGames

    AnipGames

    Joined:
    Nov 27, 2018
    Posts:
    34
    Ok, I bought it (its expensive) and tried it out. How would I make the character grab objects and climb though?
     
  24. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    868
    I guess you should spend now a few days or weeks in trying out stuff.... Using this asset does not mean this will be super easy;) You are actually trying some of the hardest things you can do regarding character control, don't expect someone give you a complete manual how to do it. There will be weeks or months of trying out, failing, and redoing, unless you are already VERY. experienced with animations and physics. I think puppet master has it's own behavior system, but I did not use it. For certain action you might also need to add Final IK. from same author, which unfortunately again costs money. you can also try this stuff on your own, with adding forces to limbs and doing some basic IK. In both scenarios, you will spend a lot of time to get it right.
     
  25. AnipGames

    AnipGames

    Joined:
    Nov 27, 2018
    Posts:
    34
    I guess your right, I'm going to put some time aside to work on learning the ropes of puppet master.
    Thank you all so much for this help!
     
  26. professionalONE

    professionalONE

    Joined:
    Apr 6, 2020
    Posts:
    5
    ldo you know what the youtuber - Dani did for it? he has ACTIVE RAGDOLLS!!