Search Unity

Mix Animations with Ragdoll

Discussion in 'Scripting' started by devel, Apr 1, 2009.

  1. devel

    devel

    Joined:
    Mar 11, 2009
    Posts:
    140
    Is it possible to mix animations with a ragdoll:
    having a character that is animated but once hit it turns fully or to a certain percentage in a ragdoll.

    Can you give me a hint on how to do that?
    Or some references where I can find more info?

    Thanks.
     
  2. maxwelldoggums

    maxwelldoggums

    Joined:
    Sep 8, 2008
    Posts:
    157
    I believe it is... But I've only experimented with animating ragdolls programatically. I would just try setting all of the joints to have a rigidbody and a collider like any other ragdoll, but then I would (in your script) set the rigidbodiy's "Is Kinematic" property to true. this would ( I think ) set the animation to play on only the kinematic joints, and the ragdoll effect would only be on the non-Kinematic joints.
     
  3. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Yes, you can mix animations and ragdolls.

    AnimationState.AddMixingTransform() is useful for this. It lets you enable animation states for each transform in the objects hierachy.
     
  4. devel

    devel

    Joined:
    Mar 11, 2009
    Posts:
    140
    Thanks!
     
  5. Tinus

    Tinus

    Joined:
    Apr 6, 2009
    Posts:
    437
  6. maxwelldoggums

    maxwelldoggums

    Joined:
    Sep 8, 2008
    Posts:
    157
    I thought Jetpack Brontosaurus was all procedural...