UniVRM icon indicating copy to clipboard operation
UniVRM copied to clipboard

The Colliders seems not work in vrm1.0

Open kankezhiyan opened this issue 2 years ago • 3 comments

Environments:

  • VRM version: 0.112.0_6a46
  • UniVRM version: not in use
  • Unity version: Unity-2021.3.26f1c1
  • OS: Windows 10

The Colliders seems not work.

I dragged a vrm10 model file into the Project(cause I couldn't find the Import option), then I dragged it into the Hierachy from the Project and got an object, then I started to play. The spring bone was working cause the hair was fluttering but they could go through the body, which means something was wrong with the Colliders, so I checked the Inspector and found this in "VRMInstance" component: image Only the first hair spring was been set with Collider Groups and all elements was same, others were empty. So I tryed to add them one by one but it still not work. I can't be sure is that someting wrong with the code or I did someting wrong when I use it. thanks.

kankezhiyan avatar Jul 05 '23 10:07 kankezhiyan

Thank you for reporting. Collider alone will not work. Are there joints?

ousttrue avatar Jul 24 '23 10:07 ousttrue

Thank you for reporting. Collider alone will not work. Are there joints?

Yep, there are joints. I also added them by myself. And there are some new stuff I found during these days. I made a test: 1 Export same model from VRoidStudio1.221, one is Vrm0 and another is Vrm10. 2 Import the Vrm0 model into Unity. 3 Do the "Migrate to vrm1" for the Vrm0, then set the "Center" in springs to "None", the collider works very well. 4 Use "Export Vrm-1.0" export this Vrm0 model to Vrm10. 5 Reimport the Vrm10 model which get from Unity, the collider works very well. 6 Import the Vrm10 model which get from VRoidStudio, the collider not work. 7 Make everything same in "VRMInstance" with the Vrm0 model, the collider still not work. Hope these can help somewhat.

Vrm0: image Vrm10: image

kankezhiyan avatar Jul 25 '23 07:07 kankezhiyan

The collision itself works fine, it's just that you just need to drag the specific component references (NOT the game object), or else each reference will simply point to the first spring bone collider group component in the game object.

The simplest way to fix this is to select the "secondary" object, right-click the inspector tab > properties to open it as a floating window, and then drag the specific spring bone collider group into the collider groups list for each spring. If you already have a collider group with the correct component references, you can also just copy/paste the entire collider group list - this is useful if the first hair group is correctly configured, since you can then just copy/paste the configuration for the other hair groups.

The core issue seems to be with the VRM 1.0 importer, which fails to correctly configure the collider groups for all but the first hair. I just wish I'd checked this first before spending an hour drilling through the code, only to come to the same conclusion...

adamlarner avatar Nov 24 '23 18:11 adamlarner