Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question Capsule collider alignment issue

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

  1. DrMeatball

    DrMeatball

    Joined:
    Nov 21, 2021
    Posts:
    116
    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:
    116
    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:
    8
    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:
    116
    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