Search Unity

GUI error: "Getting control 0's position in a group...

Discussion in 'Immediate Mode GUI (IMGUI)' started by chrischris, Jan 2, 2008.

  1. chrischris

    chrischris

    Joined:
    Oct 18, 2005
    Posts:
    19
    Using the following GUI script generates an error message when clicking the button it creates.

    The error: "Getting control 0's position in a group with only 0 controls when doing ignore"

    The script:

    Code (csharp):
    1.  
    2. function OnGUI( )
    3. {
    4.     GUILayout.Button( "Button" );
    5.  
    6.     GUILayout.BeginVertical( );
    7.    
    8.     GUI.enabled = false;
    9.     GUILayout.Label( "Label" );
    10.     GUI.enabled = true;
    11.  
    12.     GUILayout.EndVertical( );
    13. }
    14.  
    Any info on this?

    Thanks!
     
  2. shaun

    shaun

    Joined:
    Mar 23, 2007
    Posts:
    728
    The code is fine. This kind of error message generally occurs when you have a null reference being thrown inside OnGUI.

    Cheers
    Shaun
     
  3. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
    And just copying/pasting that code chunk into a new project works fine for me, no errors at all. Perhaps it's some other code causing the error instead?


    Edit: and I moved this thread to the UnityGUI section as it's GUI related.
     
  4. chrischris

    chrischris

    Joined:
    Oct 18, 2005
    Posts:
    19
    ( Sorry about the wrong forum )

    Thanks for checking the code. A new project with the code copied/pasted generates the error for me. The error does seem relatively harmless. I've submitted a bug report with the project.
     
  5. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
    No worries on the forum choice, it's not a big deal. :)

    As far as your code generating errors for you, that's odd indeed. Thanks for submitting it as a bug, we'll see if our dev/qa folks have anything to share.