Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Ragdoll Mesh Deform

Discussion in 'Scripting' started by SamYan, May 17, 2018.

  1. SamYan

    SamYan

    Joined:
    Feb 13, 2014
    Posts:
    3
    I'm just starting with Unity 3D. The problem I have, basically when the character jumps from the X height and when approaches the ground, enters in Ragdoll mode but the different parts of body deform, specifically the head. I'm using the Ragdoll Creator of Unity. I've tried to enable projection from joint character options or deegres projection angle but still deform.

    My code:

    Code (CSharp):
    1. private void RagdollMode(bool state)
    2. {
    3.     Component[] coliders;
    4.     Component[] rigidbodies;
    5.     Component[] charJoints;
    6.  
    7.     this.anim.enabled = !state;
    8.     this.capColider.enabled = !state;
    9.     this.rbody.isKinematic = state;
    10.  
    11.     coliders = this.body.GetComponentsInChildren(typeof(Collider));
    12.  
    13.     for (int i = 1; i < coliders.Length; i++)
    14.     {
    15.         (coliders[i] as Collider).enabled = state;
    16.     }
    17.  
    18.     rigidbodies = this.body.GetComponentsInChildren(typeof(Rigidbody));
    19.  
    20.     for (int i = 1; i < rigidbodies.Length; i++)
    21.     {
    22.         (rigidbodies[i] as Rigidbody).isKinematic = !state;
    23.     }
    24.  
    25.     charJoints = this.body.GetComponentsInChildren(typeof(CharacterJoint));
    26.  
    27.     for (int i = 1; i < charJoints.Length; i++)
    28.     {
    29.         (charJoints[i] as CharacterJoint).enableProjection = state;
    30.  
    31.     }
    32. }
    Any idea of why it is deformed and how it can be solved, please ? 1.png
     
  2. jamiljawhar2001

    jamiljawhar2001

    Joined:
    Jan 1, 2020
    Posts:
    3
  3. jamiljawhar2001

    jamiljawhar2001

    Joined:
    Jan 1, 2020
    Posts:
    3
    when I use blender to build a rig, mesh deforms. but in term of mixamo rig, it does not happen