SphereCollider + MeshCollider issue

Yep, another MeshCollider issue post. I’m using Unity3D v3.3.0f4

I have a cannonball fired from a cannon. It has a SphereCollider and a Rigidbody with a mass and uses gravity, nothing out of the ordinary, and I move it using physics. When it hits the ground (a CubeCollider) it explodes through OnCollisionEnter.

However, there are some rock formation models that are static and have a MeshCollider. The cannonballs sometimes explode when they hit these models, but mostly they just bounce off, hit the ground and then explode. So my reasoning is that the collision IS detected; it just bounced the ball off of the MeshCollider, right? However the Cannonball script never gets any notice of this event. I’ve tried every OnCollisionXXX and OnTriggerXXX event, but none fire.

I’ve just spent many hours on the forum, searching for solutions or tips.

  • Adding a kinematic Rigidbody to the rock doesn’t work.
  • Setting the MeshCollider to convex doesn’t do anything.
  • Decreasing the FixedUpdate time doesn’t help.

What else can I do?
And why does the cannonball bounce off the MeshCollider but doesn’t fire off an event?

Thanks in advance

Show us your collision script, maybe its something wrong with it.
Is it a simple OnCollisionEnter(){ Explode();} or do you look for certain variables?

That is actually precisely my script :stuck_out_tongue:
The cannonball needs to explode with any collision. This issue is purely about the collision detection between, and event firing of, a SphereCollider and a MeshCollider.
I’d be happy if I’d got a Debug.Log(“BOOM”)

The weirdest part is that the cannonballs SOMETIMES work correctly!
I just played my test and now they register the collision just fine.
I’ll bet that in about 10 minutes it stops working.

This leads me to conclude that it may be a UnityPlayer issue, or perhaps a Physics thingy…
I have no idea.

– edit –

I’ve added a Terrain with some painted hills, and guess what: the cannonballs explode just fine on it.
Perhaps I should look into the mesh of the rock formations…
Maybe use a custom built low poly collision mesh?