- Home /
Error when using Convex MeshColliders on iOS
Hello,
I am currently experiencing the problem that my Game when deployed to my iPhone throws a lot of Errors that seem to be in relation with the MeshColliders that are marked as convex (and also marked as inflate mesh). So these mesh colliders work just fine in the editor. As it seems that the Errors occur when Unity is recalculating them when launching the App, I was wondering whether it is possible to save the precomputed ConvexColliders from the editor to enhance loading performance and to get rid of those errors.
The Error I get is:
(Filename: /Users/builduser/buildslave/unity/build/Runtime/Mono/MonoScriptCache.cpp Line: 382)
ConvexHullBuilder: convex hull has more than 255 polygons!
(Filename: /Users/builduser/buildslave/physx/build/Source/PhysXCooking/src/convex/ConvexHullBuilder.cpp Line: 1479)
Gu::ConvexMesh::loadConvexHull: convex hull init failed! Try to use the PxConvexFlag::eINFLATE_CONVEX flag. (see PxToolkit::createConvexMeshSafe)
(Filename: /Users/builduser/buildslave/physx/build/Source/PhysXCooking/src/convex/ConvexMeshBuilder.cpp Line: 253)
Failed to create Convex Mesh from source mesh "001_Body_Centered". Source mesh is likely have too many smooth surface regions. Please reduce the surface smoothness of the source mesh. Alternatively turn on Inflate Mesh and increase the Skin Width sufficiently for this mesh.
EDIT: A strange thing happened. I also tried to build the scene without the "convex" option checked on all MeshColliders and I still get the Errors. Also I don't really get why the error occurs as "Inflate Mesh" is activated and not throwing errors in the editor.
throws a lot of Errors that seem to be in relation with the $$anonymous$$eshColliders
Uhm, don't you think that it would make sense to actually include those "errors" here in your question?
And no, you can't do any additional preprocessing. $$anonymous$$eep in $$anonymous$$d that the actual collider is a construct of Physx and not Unity.
The only known issue a convex $$anonymous$$eshCollider has is when your mesh doesn't have any volume. So for example when the mesh is a single quad but also when all vertices are in the same plane like the default Plane mesh.
I included the Error $$anonymous$$essage but I didn't think it was really necessary for the workaround question...
Answer by fred_gds · Feb 22, 2017 at 06:30 AM
So I found a solution. I could not directly access the convex Mesh created by PhysX so I used MIConvexHull (http://miconvexhull.codeplex.com) to create new meshes with less then 255 polygons. Those don't throw any Errors so kind of worth the trouble.
Your answer
Follow this Question
Related Questions
XCODE code sign error when testing on iPhone,xcode codesign error 0 Answers
Unity modules for iOS? 1 Answer
Debugging NullReferenceExceptions in iOS Games 2 Answers
Help on iOS Build in the iPhone 1 Answer
Too many colliders? 0 Answers