Search Unity

Bug Unity Editor notices only provide hindsight; no real info

Discussion in 'Editor & General Support' started by MrLucid72, May 12, 2023.

  1. MrLucid72

    MrLucid72

    Joined:
    Jan 12, 2016
    Posts:
    988
    There are so many! For example, this is the latest one:

    Code (CSharp):
    1. Should not grab hot control with an active capture
    2. UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
    Oh, an Issue? Alright, let's change this-- Nope, Unity didn't provide *any* info. No paths, no stacktraces... what's even the point? This could be a lib, a 3rd-party plugin, could be 1 of 10000 GUI scripts in a giant project... you may as well tell me that there is "a problem with something in Unity Editor" - that'd give me about the equal amount of info.

    I feel almost trolled, seeing this without info. That's like a stranger walks up to you on the street and whispers in your ear, "You shouldn't have done that" and walks away without further context. If you turn around to ask follow-up questions, he only smiles at you, silently, with contempt.
     
  2. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,858
    I believe this happens because old GUI stuff is a two layer approach. The layer that you code is somewhat independant to what's actually transpiring on screen. Thus, there's no actual callstack to offer.

    I've come across this error a bunch and it's always been as I implement a new IMGUI drawer, or am doing something that combined IMGUI inside of UI Toolkit (InspectorElement/IMGUIContainer). And it ALWAYS has happened because I have been adding/removing/changing the layout of an IMGUI drawer within the same frame as I or something else is processing an
    UnityEngine.Event
    event.

    Solution was to defer the changes in layout to the next frame, and in some causes use deferral delegates such as
    EditorApplication.delayCall
    .