Unity 2017.1.p2 Issue with GUIUtility.hotControl

It looks like there is an error happening sometimes when setting the hotControl.

Should not be capturing when there is a hotcontrol
UnityEngine.GUIUtility:set_hotControl(Int32)
CreativeSpore.SuperTilemapEditor.TilemapEditor:smile:oPaintSceneGUI() (at Assets/CreativeSpore/SuperTilemapEditor/Scripts/Tilemap/Editor/TilemapEditor.cs:669)
CreativeSpore.SuperTilemapEditor.TilemapEditor:OnSceneGUI() (at Assets/CreativeSpore/SuperTilemapEditor/Scripts/Tilemap/Editor/TilemapEditor.cs:285)
UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

I couldn’t find any information about this error. Is it a bug?

This line is triggering the error:

GUIUtility.hotControl = controlID;

And this is called before:

int controlID = GUIUtility.GetControlID(FocusType.Passive);
HandleUtility.AddDefaultControl(controlID);
EventType currentEventType = Event.current.GetTypeForControl(controlID);

Thanks for your help!

1 Like

Unity 2017 is riddled with bugs such as these. Having the same issues, +1.

2 Likes

yeah, me too… working on a custom inspector with toolbars as tabs… at least a line would help to find a workaround…

Same thing in 2017.2.0f3

Anyone filed a bug report?

hey Im having the same problem game runs nicely but when i want to build it says that there is 20 errors, Visualstudio runs fine with the scripts, no errors,

i also get this errors when building

Assets/Scripts/FollowPlayer.cs(7,12): error CS0246: The type or namespace name Vector3' could not be found. Are you missing an assembly reference? Assets/Scripts/FollowPlayer.cs(6,12): error CS0246: The type or namespace name Transform’ could not be found. Are you missing an assembly reference?
Assets/Start.cs(4,22): error CS0246: The type or namespace name `MonoBehaviour’ could not be found. Are you missing an assembly reference?

Assets/Scripts/Score.cs(4,22): error CS0246: The type or namespace name MonoBehaviour' could not be found. Are you missing an assembly reference? Assets/Scripts/PlayerMovement.cs(3,31): error CS0246: The type or namespace name MonoBehaviour’ could not be found. Are you missing an assembly reference?

some help would be appreciated

Can you share your editor log file?

Getting similar weird errors. In my case not pointing to a specific line (sometimes):

Should not grab hot control with an active capture (current=Dockarea3 (x:0.00, y:0.00, width:1501.00, height:353.00) global rect: (x:0.00, y:0.00, width:1501.00, height:353.00) new=Dockarea5 (x:0.00, y:0.00, width:223.00, height:573.00) global rect: (x:0.00, y:0.00, width:223.00, height:573.00)
UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

Should not be capturing when there is a hotcontrol
UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

I am in 2017.1.1f. Once I saw this message (the second one) pointing to one slider, and once to a button, but I can’t reproduce it anymore. I’m upgrading to see if the weird errors go away…

While writing this now I got a:

GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced)
UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

Lots of errors guys :frowning:

EDIT. Version 2017.2.0f3 solved the issues for me.
EDIT2. I still get random

Should not be capturing when there is a hotcontrol
UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

I’m not even using GUIUtility.hotControl anywhere in my code. And given it is difficult to reproduce I don’t know how could I log a bug for this.

I’m also hitting this a lot. @karl_jones , are you still waiting for someone to file a bug on this?

We have some similar sounding bugs with QA but its still worth filing your own bug report especially if its an issue for you.

@karl_jones Got a similar bug in 2017.2 when simply selecting multiple particle systems in hierarchy/inspector which have been upgraded from older versions. (Case 972613)

SetMinMaxState is not allowed with multiple different values
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
1 Like

Same issue with completely new project in 2017.3 - Happens occassionally, next time I got it I’ll send a bug report (Done: Case 980251)

Still there as well, so much for filing bug reports…

[Log] [C:/buildslave/unity/build/Runtime/UIElements/Managed/EventDispatcher.cs] Should not be capturing when there is a hotcontrol

No line number, no info on what caused it, just appeared all of the sudden. Lame sauce…

I’m getting this as well.

Anyone getting this while using OnSceneGUI events for anything mouse-related?

@karl_jones

Any update on this bug?

It was fixed in March. What version are you using?

Awesome! – could you link me to the bug case for this please?

I am currently developing an Asset (working on the 2017.1 version) and I want to be sure I can quote this if there are any issues from customers on any of these versions (plus I want to know where it originated because I want to be sure there is nothing wrong with my code, and find a way to workaround it if possible).

Thanks for the quick response, karl!

https://issuetracker.unity3d.com/issues/m-currententriesptr-equals-null-and-and-m-isgettingentries-error-thrown-when-double-clicking-on-a-specific-warning

The fix is available in 2018.1 and above.

1 Like

This is still happening in 2018.2.1f1

3 Likes

Im getting the same warning in 2018.2.10f, seems after i added #pragma warning disable to one of my scripts ( was getting the ā€œThe variable […] is assigned but its value is never usedā€ warning when the variable was being used)

Should not be capturing when there is a hotcontrol
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

@karl_jones Same thing for me using 2018.2.16f1:

3902845--332338--Capture.JPG

The message pops up from time to time; I have no idea what I was doing that triggered it.