Search Unity

Question Active Ragdoll walking like game steppy pants!

Discussion in 'Scripting' started by davitsedrakian, Nov 9, 2022.

  1. davitsedrakian

    davitsedrakian

    Joined:
    Jun 23, 2018
    Posts:
    30
    Hi People!
    Anyone can suggest me some kind off tutorial/idea of how to do this kind of active ragdollish clumsy walking, like in game Steppy Pants, the main target is that Player needs to Controll each leag separatly.

     
  2. karliss_coldwild

    karliss_coldwild

    Joined:
    Oct 1, 2020
    Posts:
    602
    I can think of a couple potential approaches.
    *) training wheel mode where holding for too long causes leg to swing back and forth -> has the downside of player getting used to it and being unhappy once you take the training wheels away
    *) pause the game once reach "optimal" initial step size. Thus giving them time for reacting to instructions telling that they need to stop pressing.
    *) incrementally slow down the closer you get to optimal position. In the first few steps you can do it so that foot never moves past the preferred position, because the closer you get the slower it moves. After first few successful steps you can slowly reduce the amount of slowdown effect making it possible to overshoot.

    Also consider adding bigger gap between instruction animation tapping. Looking at the video it gives me the feeling that you have to quickly tap a bunch of time and you can't stop. But being able to take a breath and prepare for next step would be much better for initial learning. For the purpose of challenge your probably still want to speedup later in the game as also confirmed by "faster" messages later in the video. Once it starts becoming relevant it would be nice to see some kind of continuous visual indicator for how close you are to being too slow: something like a dog which is chasing you and getting closer, or simply a bar which is draining while you stand still without moving.
     
  3. davitsedrakian

    davitsedrakian

    Joined:
    Jun 23, 2018
    Posts:
    30

    Hi! Thank you for answer, but the question was about not the "in game tutorial", but Development tutorial and how to achieve this kind of controllable ragdoll walking + balancing/falling!
     
  4. karliss_coldwild

    karliss_coldwild

    Joined:
    Oct 1, 2020
    Posts:
    602
    Sorry, misunderstood your question.

    In that case you should search for "unity active ragdolls". That should give you a bunch of results. The exact techniques vary depending on how realistic you want it to be and complexity of movements and interactions.

    The simplest approach is to more or less to have:
    * physics ragdoll
    * control feet position by your script
    * add some artifical force pulling head or shoulders up -> as long as head is being pulled up and feets are down the ragdoll will be more or less standing (just like a string puppet)
    * configure the joint coinstraints and spring forces to help maintaining somewhat human like pose

    Step 3 can be done by either directly calculating force in a script, or using a spring joint which is attached to kinematic rigidbody which is moved by script. If you are good at coding first approach can be slightly simpler, but otherwise position control is a bit easier to get working without ragdoll flying into space due to unbalanced forces.

    If that is unclear. If you don't know how to do first two steps you might want to make a separate training projects first which implement:
    * just a regular physics ragdoll -> learn how to configure joints and other physics parts so that ragdoll remains roughly human shape without too much self intersections and crazy joint poisitions. Even for a non realistic flailing ragdoll you might want some constrains.
    * stepping game with only feets that don't have the ragdoll attached -> moving feet position based on input and detecting when you stepped onto something which causes you to loose
     
  5. Nad_B

    Nad_B

    Joined:
    Aug 1, 2021
    Posts:
    730