CombineChildren and -1 size meshes

It’s really awesome that Unity allows objects to be scaled to -1 in order to ‘flip’ the mesh. I use this fairly often as it’s a convenient way to have a flipped version of an object, rather than exporting the mesh a second time. It seems to intelligently flip the normals of the mesh automatically when the scale is -1.

When I use CombineChildren on a group of objects, the flipped objects have their normals flipped. If I use the ReverseNormals script from the wiki (here) it fixes the problem, but the lighting on those objects is incorrect.

Is there any easy way to allow for -1/negatively scaled objects in a CombineChildren setup?

Have you tried using Mesh.CombineMeshes instead of the CombineChildren script?

The example for Mesh.CombineMeshes gives an error, so I’m not sure how best to use it.

“‘sharedMesh’ is not a member of ‘UnityEngine.Renderer’.”

The example seems to be somewhat “badly worded” here - I will fix that. Try replacing GetComponentsInChildren(Renderer) with GetComponentsInChildren(MeshRenderer).

Thanks for the response, but still no dice unfortunately.

I tried MeshRenderer and MeshFilter, but they all have contradictory members for this example text.

I think you actually want to pass a MeshFilter here, not any kind of renderer.

I tried the MeshFilter, and unfortunately that didn’t work.