Search Unity

Mesh Collider working fine in Editor but, not working at all in Build (collision)

Discussion in 'Physics' started by unity_VigorBioFunStudio, Feb 13, 2020.

  1. unity_VigorBioFunStudio

    unity_VigorBioFunStudio

    Joined:
    May 10, 2019
    Posts:
    10
    After upgrading from Unity 2019.2 to 2019.3 mesh colliders stopped from working in build but everything is good in editor.

    Need Help please, Thanks.
     
    awsapps, pragmascript and Nstdspace like this.
  2. Nstdspace

    Nstdspace

    Joined:
    Feb 6, 2020
    Posts:
    26
    I have the same problem. Did you try it with the newest 2019.3.1 update? I did not so far, maybe this was fixed
     
  3. unity_VigorBioFunStudio

    unity_VigorBioFunStudio

    Joined:
    May 10, 2019
    Posts:
    10
    I have solved it, Just select your object model from "Project" tap and click read/write enabled check box.

     
  4. Nstdspace

    Nstdspace

    Joined:
    Feb 6, 2020
    Posts:
    26
    I am instantiating Prefabs, which do not have such an option. Any other ideas?
     
  5. CGCowboy

    CGCowboy

    Joined:
    Mar 7, 2018
    Posts:
    17
    Dude, you just saved me a ridiculous amount of work. No way would I have thought of this. What's with the obscure solutions to these kinds of problems?

    Thank you!
     
    pedroarruda4991 likes this.
  6. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    722
    Had this exact same issue, should update here because I found more info. I was hesitant to really mess around with mesh settings if I didn't have to, so I looked for an alternate solution. If you look under this thread, it seems that in 2019.3 they added a new mesh collider cooking option. However they left it off when upgrading from a previous version, even though it is on by default if you add a new mesh collider!

    After running some experiments I concluded that the mesh colliders which weren't working were ones I had added before upgrade. Sure enough, in the component there was a cooking option called "Use Fast Midphase" which was disabled on some on them. I haven't tried it yet, but I can imagine turning on this option on for each collider will solve the collision issue. This is the best alternative to using read/write for every model, and explains why the solution is so obscure. Hopefully that helps someone in the future!
     
  7. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    722
    Just gunna follow up on this one last time. So it appears that just turning on the new "Fast Midphase" option is not enough to solve collisions working in the build. You have to actually go in and hit "Reset" from the component menu, or just delete it and re-add it. I've tested this across multiple objects and it's the only way for it to work. So it seems it's something beyond just the new option, there's something about the old mesh colliders that were just corrupted or something. Not really sure, but anyways I've gotten it to work finally. Good luck everyone!
     
  8. chantey

    chantey

    Joined:
    Mar 5, 2017
    Posts:
    49
    Came across this after a full day of debugging a build for the Oculus Quest. Enabling Read/Write on the mesh did the trick, life saver :)
     
    MichaelEGA likes this.
  9. Nixellion

    Nixellion

    Joined:
    Jun 17, 2015
    Posts:
    7
    So can anyone elaborate, which solution is better? I've tried the "Read\Write" checkbox as it seemed like quicker option, and it worked for me. But I'm not sure what the complications of this might be, and whether this is something that should now be done for every new mesh? Or just old ones?
     
  10. aoikurosaki01

    aoikurosaki01

    Joined:
    Mar 28, 2021
    Posts:
    1
    Hi! I can't seem to fine "Read/Write" checkbox since i can't see the previous picture :((
     
  11. parvalex

    parvalex

    Joined:
    Mar 2, 2022
    Posts:
    1
    I have the same issue.
     
  12. Nstdspace

    Nstdspace

    Joined:
    Feb 6, 2020
    Posts:
    26
    Can you describe more precisely what your situation is and upload some screenshots, please?
     
  13. LordRobby

    LordRobby

    Joined:
    Apr 4, 2018
    Posts:
    3
    The read/write box is on the mesh you use for your object. But not the mesh itself, its in Mesh Import Settings, one folder above the mesh. ( where you imported it )

    read_write.jpg
     
    MichaelEGA likes this.
  14. greatbulb

    greatbulb

    Joined:
    Mar 24, 2023
    Posts:
    2
    Hi,
    I am using Unity 2021.3.20f1 and facing the same issue. The collision is working in the editor but not in the build. I have tried all the suggestions given above, but still the issue is not resolved. I have tried creating a new scene and rebuilding as well, but nothing is helping. Can someone help here?
     
  15. greatbulb

    greatbulb

    Joined:
    Mar 24, 2023
    Posts:
    2
    I got this solved. I tried importing the mesh as .obj format and it worked. Is it not advisable to import collision objects in .fbx format?
     
  16. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,929
    Probably your .fbx export settings were wrong, or there was missing info (normals, for instance). The mesh once in Unity is the same regardless of the file format it was imported from, .fbx should work just like .obj.
     
  17. dema3

    dema3

    Joined:
    Sep 20, 2022
    Posts:
    5
  18. guiguibon

    guiguibon

    Joined:
    Apr 4, 2019
    Posts:
    1
    Thanx a lot i had no chance to find this.
     
  19. Lion_C

    Lion_C

    Joined:
    Oct 13, 2021
    Posts:
    8
    I'd like to post the link to the MeshCollider doc here.
    In the 'Limitations' section, you can find more details about the 'read/write' setting.
     
  20. pedroarruda4991

    pedroarruda4991

    Joined:
    Jan 9, 2021
    Posts:
    20
    King!