Search Unity

  1. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  2. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  3. Participate with students all over the world and build projects to teach people. Join now!
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Standard/Clean/Well Performing way to Implement Animation to Ragdolls in a FPS

Discussion in 'Physics' started by TheDream, Dec 5, 2018.

  1. TheDream

    TheDream

    Joined:
    Nov 25, 2013
    Posts:
    18
    Hi everyone, I need your help, I have a question I can't find an answer for :

    What is the standard, clean, and efficient in terms of performances way to implement Ragdolling at death in a FPS in Unity?


    The straight forward way of doing it is to use kinematic rigid bodies(setup with the Ragdoll Wizzard) and an animator. At death, you disable the animator and set is kinematic of each limb at false.

    The problem is that this involves a lot of unnecessary computations on each limb when the character is animated (even if collision of the limb's gameobject's layer are disabled) unity performs intersection for each of those limbs at each physics frame continuously

    having non-rigidbody colliders when the character is not dead (not ragdolized) is a bit better in terms of average performances, but also pretty unpredictable, I think it's because it sometimes involve weird recomputations of what unity consider to be the "static collision world".

    I've looked around for a while and I have still not found an answer to my issue.

    I'm very surprised because ragdolls seems to be a common practice in most games

    Not having colliders is not an option for a shooter, but those colliders are just used for raycasting, no actual mesh to mesh collisions. But apparently there is no way to disable mesh/primitive intersection computations in Unity.

    Please, I really need your help...