- Home /
Steam Overlay causing GUI graphics to glitch in Unity game on OSX.
I am working on getting the game to work on OSX, but whenever I launch the game from steam all the GUI elements turn into flat colored rectangles. On scene reload the game turns back to normal, but as soon as the Steam Overlay is used, it happens again. This only happens in the menu scenes which are almost exclusively GUI Elements, and not in the games levels itself, even though they feature GUI elements as well.
I have tried searching for a solution both on these forums and on the Steam Dev forums, but so far i have not been able to get it working. I am using Unity 5.2.1f1, /Steamworks.NET 7.0.0 and OSX 10.10.5 for running the game.
Anyone that has been able to solve a problem like this?
EDIT: Forgot to mention this but the game works fine when turning the Steam Overlay off. The problem lies in wanting to use the steam overlay in the game, for which it should not be disabled.
EDIT2: I filed a bug report as suggested. You can find it here to track its status. https://fogbugz.unity3d.com/default.asp?746323_alpd00iof5lqh693
EDIT3: Upgraded to Unity 5.2.3f1 and Steamworks.NET 8.0.0, but the problem still persists.
Answer by KweenieMike · Dec 08, 2015 at 12:02 PM
In case anyone was wondering, I found a workaround that worked for me. It basically meant placing a 3D Cube in every scene which consisted of only GUI components, which is where the problem mostly occurred. This apparently makes the Steam Overlay behave as far as i can tell.
Example of how I did it in Unity. I made a gameobject in the very first scene with a script on it. In the awake it invokes DontDestroyOnLoad(this.gameobject);
to ensure its persistence.
The script itself consists mostly of this: void OnLevelWasLoaded(int level) { if (!(invisibleObject != null)) { return; } if (!((level < 1 || level > 20) && level < 25)) { return; } Camera[] cameras = GameObject.FindObjectsOfType (); foreach(Camera camera in cameras) { GameObject.Instantiate(invisibleObject, camera.transform.position + camera.transform.forward * 1f, camera.transform.rotation); } }
invisibleObject is a prefab of a 3dCube without any modifications or anything, except for assigning the layer to the Ignore Raycast layer, just in case.
Still think this problem should be better solved, but this workaround works for now.
Thanks $$anonymous$$weenie$$anonymous$$ike! Worked for me too, you're a lifesaver!
Answer by MCoburn · Nov 18, 2015 at 11:19 AM
Might be a OS X quirk, or something to do with the Steam integration. Can you try turning off the Steam Overlay and see if that fixes it? If it does, then it's likely that it's a drawing issue with Steam and Unity's GUI framework.
Hmm, forgot to mention that in the question, but turning off the S$$anonymous$$m Overlay does fix it. The problem with this is that I would like to fix it for the S$$anonymous$$m Overlay as well, so that can be used ingame for Achievements and such. Otherwise the solution would be to tell users to turn off the S$$anonymous$$m Overlay on OSX, which seems annoying for either party.
I filed a bug report as you suggested. Hope it helps. https://fogbugz.unity3d.com/default.asp?746323_alpd00iof5lqh693
Your answer
Follow this Question
Related Questions
Most Gui elements do not appear on Mac Os WebPlayer 1 Answer
Steam Overlay crashes the game on certain macs 2 Answers
Problems setting up Unity & Gear VR for development on Mac 1 Answer
IMGUI Color Space problems on Mac and Xbox One. 0 Answers
In-app purchase "Invalid product" on Mac Store build 0 Answers