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

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.

3 Likes

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

I have solved it, Just select your object model from “Project” tap and click read/write enabled check box.
!(http://
)

7 Likes

I am instantiating Prefabs, which do not have such an option. Any other ideas?

1 Like

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!

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!

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 :)

1 Like

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?

Hi! I can't seem to fine "Read/Write" checkbox since i can't see the previous picture :((

I have the same issue.

Can you describe more precisely what your situation is and upload some screenshots, please?

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 )

8409078--1110993--read_write.jpg

1 Like

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?

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?

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.

I’m having a similar issue with Physics.OverlapSphere not picking up my generated meshes in a webGL build. But everything works fine in the editor.
I described my problem a bit more here Issue with dynamically generated mesh detection in unity build . I’ve tried a few different things, but am pretty stuck with what to do next. Any help would be greatly appreciated. Thanks!

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.