I have an issue where my collisions are ignored in the WebGL build, even though they work in the editor.
Here’s what’s happening:
Example 1: GIF by alicefromairconsole | Gfycat
Example 2: GIF by alicefromairconsole | Gfycat
The tank GameObject is a Rigidbody with Capsule Colliders.
The orange “floor” is a Mesh Collider, that white thing is a Box Collider.
If the Rigidbody ‘touches’ a Mesh Collider for the first time, it falls through, there is no collision.
If the Rigidbody first collides with a box collider however, the collision works, and after that it also collides as it should with Mesh Colliders.
In the Unity Editor, all collisions work as they should.
The issue is the same with both Convex and non-Convex Mesh Colliders.
My workaround for the moment is just to place an extra box collider for the Rigidbody to collide with “first”, but that can’t be the best solution to this. Any ideas?
Edit: I tested some more, and this also happens in an entirely empty project with just one Mesh Collider and a Rigidbody (Sphere) in it.
Even more strangely, the angle of the Mesh Collider makes a difference: As soon as the mesh collider is rotated a little, the collision works as it should.
Example 3: GIF by alicefromairconsole | Gfycat
Example 4: https://streamable.com/4y0k0
(only mesh rotation changed between these two).
In my own project, the collision also works when I rotate the “floor” mesh slightly.
Is this a bug or is there something I’m missing here?
Edit 2:
Link to build: Unity WebGL Player | New Unity Project
Link to project folder: https://drive.google.com/open?id=0B1LEzX86fi3pTnFFOHU1UTFWelk
It seems to be an issue specific to meshes made in Blender.
Edit 3:
Another test build: Unity WebGL Player | New Unity Project
Happens both with .blend files as well as blender fbx exports, but not with Wings3D, for example.
Edit 4: The issue does not happen with an obj file exported from blender, so the problem is somewhere either in the Blender export or the Unity import…