Triangle Mesh and Heightfield Trigger are not supported!

Hi i have stumbled upon this error in one / some of my scenes…
I have no clue what it means or how to remove it!

The precise error message is as following:

NpShape::setFlag(s): triangle mesh and heightfield triggers are not supported!

I would really like to know how to remove this as i am pretty sure that it is this error that is making my scenes lag under startup! Thanks in advance for any help i can get :slight_smile:

It’s most likely because you have a mesh collider component set to be “is trigger” somewhere in your project. Going forward Unity 5 does not support this setting. I’m sure there’s a reason for this, but I sure couldn’t tell you what it is. It created some problems in my own project and I had to figure out a workaround. :frowning:

1 Like

Well chingwa… i have some extremely good news :smile: it was simply because ALL of my objects that called this error had a mesh collider attached to them (some were isTrigger enabled!) but i found that turning on Convex made the error disappear :smile:

Woah. So that’s why I’m getting these errors. That’s kind of serious for me. Do you mind if I ask what your work around was? The colliders for my roads are generated by splines so making them convex isn’t really an option.

And those colliders are triggers?

PhysX 3.3 doesn’t support non-convex mesh triggers, so you’re going to have to break your trigger down into convex pieces (or into overlapping BoxColliders or similar).

I can’t seem to find any colliders in my scene that have “Is Trigger” checked. Does anyone know a way to search for them?

A little editor script is probably the simplest way:

public void SelectAllMeshTriggersInScene()
{
   Selection.objects = FindObjectsOfType<MeshCollider>().Where(mc => mc.isTrigger && !mc.convex).Select(mc => mc.gameObject).ToArray();
}
1 Like

Yes that works, unless your mesh collisions don’t work properly with a convex mesh, as in my case :frowning:

For my project I was using them as triggers in order to accept raycasts… I turned them off from being triggers in order to get rid of the error, and then put them on their own layer and disconnected that layer from all the other game layers in the physics settings… this way no other game objects will interact with those colliders, but the raycasts still work. It’s a bit annoying to have to do this, but it worked in my case.

1 Like

Ah I see. Thank you, that’s a good solution. I can do the same since I’m doing a raycast straight down to determine footstep sounds anyway.

(That wasn’t me, but yes, I agree it sounds like a good solution).

Oh whoops I meant to quote @chingwa

This error is doing my head in. I get 5 of these pop up every time I hit play and then 5 more when I hit stop. I have triple checked my scene and I definitely don’t have any mesh triggers, let alone any that aren’t set to convex.

I don’t I know what else to do. Could the error message be updated to say which object is causing it or something?

Edit, every now and then I get a slightly longer version of the error on it’s own. It reads:

NpShape::setFlag(s): triangle mesh and heightfield triggers are not supported!
UnityEditor.DockArea:OnGUI()

Any ideas?

That’s weird… maybe something from the assetstore?

Good idea. Although, unfortunately, the only thing I’m using from the asset store is a skybox.

Hmm…

I can’t for the life of me think of why you would use a mesh collider in an onGUI method…

It’s more likely the UnityEditor.DockArea:OnGUI() part is not related to the actual problem, but just an artifact of the error reporting. When I googled just “UnityEditor.DockArea:OnGUI()” I found a ton of unrelated errors that had it in the string somewhere.

Did you try the editor script Superpig posted?