Can anyone out there think of any reason why a Box Collider would detect the OnTriggerEnter event, while a MeshCollider wouldn’t?
There is quite literally no change in the gameObjects structure, or the code at all, other than that if I try and use my custom MeshCollider (which is actually an exact duplicate of the crafts mesh) it detects nothing. Yet swap the Collider to a Box, Sphere etc, it all works correctly.
Its not a case of the mesh being inside out either, as even Convex (which actually ruins the collider mesh) doesn’t work. Nothing seems to work the minute I use MeshCollider.
Thanks for any tips.
Any backfaces on your mesh? The mesh collider doesn’t work for backfaces.
Nope, none at all, I actually tried just a simple triangular custom mesh as a MeshCollider too, nothing. It works absolutely fine as long as its not a MeshCollider.
The only change I make, is to delete the MeshCollider Component, replace it with ANY of the other collider types, and it works. No changes in code, notta. So somehow, it HAS to be an issue with the MeshCollider itself. Now normally, I would assume my mesh may be inverted (inside out, backfaces etc) but this just isn’t the case. The mesh is truly fine, but wont work O.o
Also, I have tried Unitys Collider Generation, and it appears to create the exact mesh as it should, but no events.
I really don’t understand this, it SHOULD be working, but alas, this is not so.
Actually, sorry for double post, but it seems I may have actually had an issue with the other meshes (asteroids involved)… and I completely overlooked that.
By adjusting the meshes on the asteroids, the ships custom mesh, begins to work.
I feel silly, but your tip definitely helped me look at other possible causes. And seemed to have fixed it.
Thanks mate.