Search Unity

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

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

  1. TheTortilla

    TheTortilla

    Joined:
    Nov 25, 2013
    Posts:
    38
    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...