Camera unchecking default culling mask by itself after update to Unity 5

I just updated to Unity 5 and for some reason my cameras are unchecking the default culling mask when I start my game (the other layers stay checked). The culling mask on Awake and Start still has “default” selected but somewhere after that it gets removed. I have no idea what’s going on.

Search your project code for any instance of “.cullingMask”. Hopefully you’ll find something which is changing it and you can simply remove that call, or edit it as needed.

I found out that NGUI was causing this. I was instantiating widgets using Instantiate instead of NGUITools.AddChild. The widgets would then have no panel, so NGUI would create one for them. The UIRoot that was created had the default layer unchecked and would then cause all other cameras to uncheck the default layer too.