Search Unity

Ragdoll

Discussion in 'Physics' started by krissnord, Aug 15, 2017.

  1. krissnord

    krissnord

    Joined:
    Sep 26, 2015
    Posts:
    4
    So I have a "Enemy" and a "Player" and when the enemy dies I want the player to still be able to interact with the enemies dead body like in the souls game. How would I go about doing something like that?

    And one other small question I also want the enemy to drop his weapon on death, is this doable?
     
  2. krissnord

    krissnord

    Joined:
    Sep 26, 2015
    Posts:
    4
    Bump from a noob
     
  3. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    hello.

    to turn a character to ragdoll, you can premade a ragdoll version of the character and turn it on when character dies
    OR
    make character's rigidbody kinematic when using animations, and when dies:
    - turn animator enabled = false;
    - turn capsule collider isTrigger = true;
    - turn capsule rigidbody isKinematic = true;
    - turn capsule rigidbody useGravity = false;
    and switch all joints of ragdoll on
    - collider isKinematic=false;
    - rigidbody useGravity=true;
    - rigidbody collider isTrigger=false;

    here's a project you might learn from (I did not check it)
    http://www.hernanzaldivar.com/2013/11/unity3d-kill-character-and-make-him-die.html

    to drop weapon you need to do a similar thing
    - turn collider enabled=true;
    - rigidbody isKinematic=false;
    - unparent gun.transform.parent = null;