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. Dismiss Notice

Question Capsule collider alignment issue

Discussion in 'Physics' started by DrMeatball, Aug 18, 2022.

  1. DrMeatball

    DrMeatball

    Joined:
    Nov 21, 2021
    Posts:
    85
    This is probably simple and obvious but I haven't figured it out yet.. How do I adjust the angles/alignment of a capsule collider?

    These colliders were auto generated by Ultimate Character Controller and are about 80% there, but I clearly need to refine them.

    colliders.png
     
  2. DrMeatball

    DrMeatball

    Joined:
    Nov 21, 2021
    Posts:
    85
    Got it! Never did figure out how to edit colliders properly so I went back in time and fixed my FBX export. I still need to scale the colliders but that I know is doable. Hazzah!

    _IMG_20220818_164448_01_.jpg
     
  3. Nupixo

    Nupixo

    Joined:
    Jan 21, 2016
    Posts:
    5
    I see this is the same issue I encountered with colliders when using a Daz model. Can you share what you did to fix this?
     
    DrMeatball likes this.
  4. DrMeatball

    DrMeatball

    Joined:
    Nov 21, 2021
    Posts:
    85
    Sure!

    The problem is DAZ to Unity bridge internally resets the bone structure when you export based on a pre-baked A pose.

    1) Copy/paste this script (call it TPose.dsa or whatever you want), it'll convert your currently loaded A pose character to a T pose.

    2) Go to Tools menu -> Joint Editor, right click on a character joint and select Edit->Bake Joint Rotations. Without the T joints baked the bones reset to the A pose even if your character pose is T / correct.

    Do a "Send To Unity" and you should be good to go.

    Lemme know if you have any issues!

    Code (Boo):
    1. // DAZ Studio version 4.8.0.59 filetype DAZ Script
    2.  
    3. var oSkeleton = Scene.getSelectedNode( 0 );
    4. if( oSkeleton.inherits( "DzBone" ) )
    5. {
    6.     oSkeleton = oSkeleton.getSkeleton();
    7. }
    8. beginUndo();
    9. oNode = oSkeleton.findNodeChild( "rThighBend", true );
    10. oZRotCtrl = oNode.findPropertyByLabel( "Side-Side" );
    11. nZRot = oZRotCtrl.getValue();
    12. oZRotCtrl.setValue( nZRot + 6 );
    13. oNode = oSkeleton.findNodeChild( "lThighBend", true );
    14. oZRotCtrl = oNode.findPropertyByLabel( "Side-Side" );
    15. nZRot = oZRotCtrl.getValue();
    16. oZRotCtrl.setValue( nZRot - 6 );
    17. oNode = oSkeleton.findNodeChild( "rShldrBend", true );
    18. oZRotCtrl = oNode.findPropertyByLabel( "Bend" );
    19. nZRot = oZRotCtrl.getValue();
    20. oZRotCtrl.setValue( nZRot - 45 );
    21. oNode = oSkeleton.findNodeChild( "lShldrBend", true );
    22. oZRotCtrl = oNode.findPropertyByLabel( "Bend" );
    23. nZRot = oZRotCtrl.getValue();
    24. oZRotCtrl.setValue( nZRot + 45 );
    25. acceptUndo( "G3F G8F pose adjust" );
    26.  
    Good bones will look like this.

    Screenshot 2023-05-10 192645.png