Failed Setting Triangles Error

Recently, a reader sent me the following screenshot which shows a corrupted scene from my book’s demo project.

He also showed me the errors and warning he get when running the demo project:

Warning:

Lightmap snapshot ‘LightmapSnapshot’ is inconsistent – 62 files out of 248 are missing. Realtime GI will be disabled. Please rebuild lighting for this scene.

Errors:

Failed setting triangles. Some indices are referencing out of bounds vertices. IndexCount: 600, VertexCount: 11191
UnityEditor.UnityBuildPostprocessor:OnPostprocessScene()

Failed setting triangles. Some indices are referencing out of bounds vertices. IndexCount: 96, VertexCount: 11191
UnityEditor.UnityBuildPostprocessor:OnPostprocessScene()

This happens when Unity tries to convert the demo project to the latest version, which sometimes might mess up the files.

Solution:

To solve this issue, reimport the mesh which has been corrupted by the conversion (in this case, terrain and rocks) by right clicking on the asset in Unity and choose “Reimport”, or delete the prefabs from the scene and place it again manually.

Once you have done the steps above, re-bake the lighting again and everything will work fine.

Leave a Reply

Your email address will not be published. Required fields are marked *