Search Issue Tracker

Fixed in 2022.1.X

Fixed in 2021.1.X, 2021.2.X



Found in



Issue ID




GUIStyle errors are thrown when entering Play mode with docked Profiler and the "Maximize On Play" option Enabled



To reproduce:

1. Download the attached "" project and open in Unity
2. Open the "SampleScene" scene
3. Open Profiler window and dock it near Console or anywhere else
4. In Game View enable the "Maximize On Play" option
5. Enter Play mode

Expected Results: Everything works as Expected
Actual Results: Errors are spammed in Console:

"Unable to use a named GUIStyle without a current skin. Most likely you need to move your GUIStyle initialization code to OnGUI
UnityEngine.GUIStyle:op_Implicit (string)
UnityEditorInternal.ProfilerTimelineGUI/Styles:.ctor () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerModules/CPU/ProfilerTimelineGUI.cs:210)
UnityEditorInternal.ProfilerTimelineGUI:get_styles () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerModules/CPU/ProfilerTimelineGUI.cs:231)
UnityEditorInternal.ProfilerTimelineGUI:InitializeNativeTimeline () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerModules/CPU/ProfilerTimelineGUI.cs:2673)
UnityEditorInternal.ProfilerTimelineGUI:Clear () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerModules/CPU/ProfilerTimelineGUI.cs:1348)
UnityEditorInternal.Profiling.CPUProfilerModule:Clear () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerModules/CPU/CPUProfilerModule.cs:92)
UnityEditorInternal.Profiling.CPUOrGPUProfilerModule:OnDisable () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerModules/CPUorGPUProfilerModule.cs:308)
UnityEditorInternal.Profiling.CPUProfilerModule:OnDisable () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerModules/CPU/CPUProfilerModule.cs:81)
UnityEditor.EditorApplicationLayout:InitPlaymodeLayout () (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/EditorApplicationLayout.cs:59)"

- This issue appears both on Windows and OSX
- This issue is not reproducible when Profiler is undocked and the "Maximize On Play" option is Enabled/Disabled
- This issue is not reproducible when Profiler is docked and the "Maximize On Play" option is Disabled
- Sometimes Unity on MacOS throws different Errors:

"NullReferenceException: Object reference not set to an instance of an object
UnityEditor.ProfilerWindow.SaveViewSettings () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerWindow.cs:682)
UnityEditor.ProfilerWindow.OnDisable () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerWindow.cs:367)
UnityEditor.EditorApplicationLayout:InitPlaymodeLayout() (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/EditorApplicationLayout.cs:59)"

"IConnectionState was not Disposed! Please make sure to call Dispose in OnDisable of the EditorWindow in which it was used.
UnityEditor.Networking.PlayerConnection.GeneralConnectionState:Finalize () (at /Users/bokken/buildslave/unity/build/Editor/Mono/Networking/PlayerConnection/AttachToPlayerGUI.cs:373)"

Reproducible on Unity 2021.1.16f1, 2021.1.21f1, 2021.2.0b11 and 2022.1.0a8
Not reproducible on Unity 2019.4.30f1, 2020.3.18f1 and 2021.1.15f1
Regression on Unity 2021.1.16f1

Comments (8)

  1. MarekWieczorek

    Apr 12, 2022 16:32

    Na szczęście nie sprawia to żadnych problemów – przynajmniej nie w moim przypadku. Daj mi znać, jak dobrze bawiłeś się w kasynie. Każda pomoc byłaby bardzo mile widziana. Jestem zawodowym graczem w pokera i dziennikarzem kasynowym, który dużo wie o grze. Pokażę ci, jak grać w dziesięciu najlepszych kasynach ze złotem na świecie. Więcej informacji na stronie Przy wpłacie 10 zł masz największą szansę na wygraną.

  2. ShiningMichal

    Mar 24, 2022 09:53

    2021.2.4f1 error show every time if I maximixe window by pressing shift+space on scene view window

  3. xxflecsoxxeduc

    Feb 07, 2022 11:57

    Same for 2021.2.8f1

  4. StPaulStylee

    Oct 21, 2021 10:58

    Exact same scenario that has been spelled out below. Luckily, it doesn't seem to cause any breaking issues - not in my scenario at least.

  5. charliebob49

    Oct 11, 2021 17:12

    I am using 2021.1.24f1 and also has the ONGUI error. The only way I can get it to stop is too close the profiler. If I then restart the profiler it does not give the error unless I dock it to any window. As long as it is open in its own window there is no error. I agree with GASPEDAL it sound like a bug.

  6. Bubblehead333

    Sep 30, 2021 19:58

    I get this issue on 2021.1.16f too. Entering Play Mode with Profiler docked and Maximise On Play option selected returns the above errors.

    Not having Maximise On Play turned on seems to stop errors.

  7. univepro

    Sep 30, 2021 06:25

    I'm using Unity 2021.1.19f1 on a Windows 10 PC. This issue showed up after I started using the profiler about 3 or 4 days ago. I may have had the game window on Maximize On Play at the time, but the Profiler is currently docked and Maximize On Play is not selected. The errors still populate every time I play the game.

  8. Gaspedal

    Sep 11, 2021 21:11

    Same here with 2021.1.16f
    Even when I create a new empty 3d project and click on "play" , I get this GUI Error Message.
    Seems like a Bug.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.