Search Unity

How to apply bullet impact force to animated ragdoll

Discussion in 'Physics' started by doarp, Dec 18, 2019.

  1. doarp

    doarp

    Joined:
    Sep 24, 2019
    Posts:
    147
    I have an animated character, with ragdoll RogidBody parts that are kinematic when it's animated.
    When I hit it with a bullet, I disable the animator and turn the RigidBody part to dynamic so that ragdoll behaves naturally.
    But I also want the force from the bullet impact to apply to the ragdoll.
    How do I do that? Since when the original bullet-ragdoll happens, the character is still animated and isn't impacted by the bullet force, and when I turn off the animation the force from the impact has already been "lost".
     
  2. SUUNE

    SUUNE

    Joined:
    Mar 10, 2019
    Posts:
    65
    Did you try to capsule raycast around character and when bullet get to it turn on ragdoll? Or raycast in front of a bullet and turn on ragdoll when bullet raycast get to the player?