Search Unity

Ragdoll question

Discussion in 'Editor & General Support' started by yellowlabrador, Jan 8, 2007.

  1. yellowlabrador

    yellowlabrador

    Joined:
    Oct 20, 2005
    Posts:
    562
    Hello All,

    Trying to play with the ragdoll wiz and everything seems to work fine but Having some problem. See pic below. The model has some extra transforms like bones on fingers, necks, toes etc and this transform was not drag in to the wizard( only drag what I thinks should be there per wiz, ie. hip, shoulder,leg, etc.). Not sure here what's causing this problem.

    Thanks for any help.
    Ray
     

    Attached Files:

  2. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Do you have your character rig setup so that there is a common root?
    You have to make sure that this root, which contains all the child nodes is hooked up to be the root in the ragdoll wizard. Otherwise those bones will not be affected by the ragdoll -> stay in place while other parts of the body move around.
     
  3. yellowlabrador

    yellowlabrador

    Joined:
    Oct 20, 2005
    Posts:
    562
    Hi Joe,

    Yes I believe I have the root set up.

    I unchecked freeze rotation on all rigidbody inside the ragdoll and it seems to work fine as long as the clown missed the barrel.

    If the clown goes inside the barrel, the problem shows up. see attached pic.

    Trying to look at the script for the barrel(have some triggers inside to activate the water splash and scoring stuff) if it has something to do with it.

    Thanks,
    Ray
     

    Attached Files:

  4. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    Did you do this in Maya?

    I had this type of thing when the skin Bind was not set to the ideal set of influences..

    Do a series of skin-bind skin experiments and test them all in Unity. Theres not really a faster way. Endless dragging dropping in Ragdoll wizard. But you should get there in the end. If you wanna post a model I'll check it out.
    AC
     
  5. yellowlabrador

    yellowlabrador

    Joined:
    Oct 20, 2005
    Posts:
    562
    @targos

    Yes, it was done in Maya. Will try your suggestion about binding (Still learning Maya).

    The thing is, when the character is not inside the barrel, everything is fine.
    It only happens when the ragdoll enters the barrel(barrel has trigger inside).

    Any joints that enters that trigger collider, the joint get stretch out on the same location.

    Thanks,
    Ray
     

    Attached Files:

  6. pete

    pete

    Joined:
    Jul 21, 2005
    Posts:
    1,647
    hahaha! cool game... throwin clowns into barrels of water! hahaha... oh wait you don't hate clowns too do you? ;)

    i'd bet if it only happens in the barrels but is ok everywhere else, that it's something with the barrel script rather than the ragdoll. i'd keep looking there or at the trigger event.
     
  7. yellowlabrador

    yellowlabrador

    Joined:
    Oct 20, 2005
    Posts:
    562
    I hate clowns! :)

    Problem was in the script(trigger). the script will destroy the clown once it enters the trigger, Instead its destroying the first collider GO that enters the trigger but not the rest of the ragdoll.

    Works fine with a cube or sphere but not on a clown. Stupid Clown!
    :D

    Thanks,
    Ray
     
  8. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    You probably want to check where the transform nodes end up when the issue happens. Just pause the game, make sure to have the pivot triangle in toolbar turned on and go through the nodes to see where they are placed. Maybe some parts of the ragdoll get stuck between some colliders?
     
  9. yellowlabrador

    yellowlabrador

    Joined:
    Oct 20, 2005
    Posts:
    562
    Hi Joe,

    Some colliders in the ragdoll are getting destroyed once it enters the trigger inside the barrel. The knee collider has a child ankle joint, so if the knee gets destroyed the ankle joint gets thrown out somewhere in the zero position of the screen (Zero coordinates?).

    I have a OnTriggerEnter script to destroy the clown and I think I need to fix the destroy to actually destroy the entire clown starting from the root and all its child.

    The barrel has a mesh collider and 4 box collider surrounding the barrel and a trigger collider inside the barrel, the clown at some angle slices thru the barrel, another issue I'm having.

    What I'm trying to do is, when the clown gets dunked in the barrel, water splash(got this part), play water splash audio( got this one too)

    Destroy entire clown(problem here) and

    record only one score(Problem here too... if both feet or entire clown is in the barrel, it records the number of colliders destroyed)

    Attached the script of the trigger and some screen shots.

    Code (csharp):
    1.  
    2. /*Script to count the number of clowns dunked,play audio file, emit particles. Attached this script to a trigger inside the barrels*/
    3.  
    4. var clown : GameObject;
    5. var dunkedClownWhite : int = 0;
    6.  
    7. function OnTriggerEnter(clown : Collider)
    8. {
    9.     if(clown.attachedRigidbody)
    10.         {
    11.            
    12.             dunkedClownWhite ++;
    13.             audio.Play();
    14.             particleEmitter.emit = true;
    15.             Destroy(clown.gameObject);
    16.             yield WaitForSeconds(3);
    17.             particleEmitter.emit = false;
    18.         }
    19. }
    20.  
    If I comment the Destroy(clown.gameObject) everything is fine with the clown but it still records the number of colliders that entered the trigger.

    Hope I'm making sense.

    Thanks
    Ray
     

    Attached Files:

  10. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Code (csharp):
    1.  
    2. var clown : GameObject;
    3. var dunkedClownWhite : int = 0;
    4.  
    5. function OnTriggerEnter(clown : Collider)
    6. {
    7.  
    So the question is what are you trying to do here? you have clown referring to the collider and above you have it referring to a game object member variable? You probably want to choose different names.

    When destroying if you want to kill the whole clown you probably just want to do:

    Code (csharp):
    1.  
    2. // Destroy the root game object of the clown
    3. Destroy(clown.transform.root.gameObject);
    4.  
     
  11. yellowlabrador

    yellowlabrador

    Joined:
    Oct 20, 2005
    Posts:
    562
    Hi Joe,

    Thanks, Destroying the root did it.

    As for the var clown, changed the name to ragdoll and added to the if statement
    Code (csharp):
    1.  
    2. function OnTriggerEnter(clown : Collider)
    3. {
    4.     if(clown == clownRagDoll)
    5.  
    Thanks my clown is not that stupid anymore! :)

    Ray
     
  12. pete

    pete

    Joined:
    Jul 21, 2005
    Posts:
    1,647
    i still hate him :p

    glad you got it sorted!