Game Dev

Unity crash on Linux. Steam overlay issues on Mac OS X.

While porting a Unity game on Mac OS X and Linux, I I just stumbled upon two strange problems. I’m working on Unity 5.1.0 and when I’m building the game for Linux, it works just fine inside the Linux experimental 5.1.0 editor, but when I launch a standalone Linux build, it crashes on an NGUI menu. The Player.log file shows a generic “unhandled NULL exception”.  The problem disappears if I create a development build, but obviously I cannot ship a game with a “development build” label on the bottom right of the screen. The issue disappears when building with Unity 4.x.

The issue on Mac OS X appears when the game is launched by the Steam client. When I open the Steam overlay (shift + tab) over a NGUI menu, the screen becomes blue or green.

I have found here and here that these issues on Mac and Linux seem to be connected. As you can read there, these problems can be easily fixed with a simple hack, just putting an invisible label in an OnGUI method inside a GameObject in the scene. Here is the code:

This simple code fixed all the issues in my game, both on Linux and on Max OS X.

Leave a Reply