Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity automatically added a mesh Collider and returned an error

Discussion in 'Physics' started by green21st, Jan 31, 2020.

  1. green21st

    green21st

    Joined:
    Jan 2, 2020
    Posts:
    1
    I'm using unity 2019.2 to create a windows standalone 64 app, and using a script to create a plane:
    GameObject tile = GameObject.CreatePrimitive(PrimitiveType.Plane);
    tile.layer = LayerMask.NameToLayer("tiles");
    tile.AddComponent<BoxCollider>();
    tile.AddComponent<Rigidbody>();
    tile.GetComponent<MeshRenderer>().material.color = color;
    tile.GetComponent<Rigidbody>().useGravity = false;
    tile.GetComponent<Rigidbody>().angularDrag = 0 ;

    an error is occoured during the runtime:
    Non-convex MeshCollider with non-kinematic Rigidbody is no longer supported in Unity 5.

    I didn't add this in the script, but I can find a MeshCollider in the editor while runing.

    How can I solve this problem?
    upload_2020-1-31_12-50-50.png
     
  2. Ramster445

    Ramster445

    Joined:
    Jan 18, 2019
    Posts:
    5
    Hey, dont know if you found this out but you will need to set the property "convex" of the mesh collider to true, hence Unity doesnt support non kinematic rigidbodies without a convex anymore.