Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

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

Discussion in 'Editor & General Support' started by Don-Gray, Mar 11, 2015.

  1. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    Getting a number of these in my U5 project.
    This topic in the old Unity 5 Pre-Order forum (now closed) talks about it.
    SuperPig also posted a small script:
    Code (CSharp):
    1.  
    2. public void SelectAllMeshTriggersInScene()
    3. {
    4.     Selection.objects = FindObjectsOfType<MeshCollider>().Where(mc => mc.isTrigger && !mc.convex).Select(mc => mc.gameObject).ToArray();
    5. }
    6.  
    But when I create the script in my project I get this error:
    I'm not a scripting guy so could use some help with this.

    Thanks
     
  2. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Getting same error: NpShape::setFlag(s): triangle mesh and heightfield triggers are not supported!
    Is this something to do with .obj files?
     
  3. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    SuperPig wrote:

    "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)."

    Just got the meaning myself, but will have to wait until I can try it.
     
    MrEsquire likes this.
  4. JOKaija

    JOKaija

    Joined:
    Feb 8, 2015
    Posts:
    161
    Create a new gameobject and add this script to it. Then put your gameobject to scene and run it.

    You will see on Warning log, where it finds a "triggered" meshes.

    using UnityEngine;
    using System.Collections;

    public class FindTriangles : MonoBehaviour {
    MeshCollider[] glist;
    void Start ()
    {
    glist = FindObjectsOfType<MeshCollider>();
    foreach(MeshCollider mc in glist)
    {
    if (mc.isTrigger && !mc.convex)
    {
    Debug.LogWarning("Found 'triggered' mesh: "+mc.name);​
    }​
    }​
    }​
    }
     
  5. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    Thanks, will check it out!

    :)