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:


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


Failed setting triangles. Some indices are referencing out of bounds vertices. IndexCount: 600, VertexCount: 11191

Failed setting triangles. Some indices are referencing out of bounds vertices. IndexCount: 96, VertexCount: 11191

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


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.

LANManager Supports UNET

Surprisingly, the plugin I made for Unity called LANManager supports UNET out of the box. The plugin was made in last year, before Unity rolling out their new networking system called UNET, which is a complete remake from scratch.

LANManager is a Unity plugin that helps to propagate your Unity-based game throughout the local network and allows other clients to discover the game server automatically without the need to manually insert the server’s IP address.

The plugin seems to work fine without any modification to the code, except a small change is required for the sample project to run on the latest Unity – replace the Network View component attached on the character prefab with the Network Transform component and that’s it.

The reason why it still work is mainly because Unity didn’t change much of the abstraction layer, except the underlying architecture which is not exposed to the users. Event names such as OnConnectedToServer, OnPlayerConnected, etc. remain the same so it didn’t break any of the functions in LANManager. Good job to the engineers at Unity Technologies!

Reviving an old project?

There’s an old hobby project which has been in hiatus for several months now. The idea started as a series of character concept art I did back in 2010 for my final year project but for some reason it didn’t get chosen, so I decided maybe I could use it for my own game.

Few months ago, I created the character model in Blender and a friend of mine did the environment props in 3D Studio Max. I put them together in Unity and wrote some scripts to make the character move (run, jump, double jump, climb ladder, etc.) and even did a simple NPC dialog system. But that’s all, it’s been staying the same since then, as both of us were very busy with jobs and other stuff. Now I’m thinking maybe it’s a good idea to post it out on my blog so that I can remind myself from time to time that there is a hobby project awaiting for completion.

The game is a story-based, character-oriented adventure game with puzzle elements in its gameplay. Player will be going through the game levels to solve certain puzzles and achieve certain objectives, which slowly revealing the story and the relationship between the characters in the game. There will be several characters who are teenagers but look really weird with their costumes and behaviors. They live in an alternate universe which is very different from ours and player will be learning more about their world throughout the game. However, I have not settled with the details yet so there are much more works to be done.

Ignore the scaling in the last screenshot. The scaling wasn’t correct, I was merely showing my friend how the models looked like in Unity compare to what he saw in 3D Studio Max.

Need to squish out some time for this hobby project so that I can keep my passion in game development, as my current job is more toward software engineering rather than games.