# Gui not showing.

**URL:** https://discussions.unity.com/t/gui-not-showing/596073
**Category:** Scripting
**Tags:** Scripting
**Created:** [September 3, 2015, 10:28am UTC](https://discussions.unity.com/t/gui-not-showing/596073 "2015-09-03T10:28:01Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![anon23430162](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@anon23430162](https://discussions.unity.com/u/anon23430162)
#### Post date: [September 3, 2015, 10:28am UTC](https://discussions.unity.com/t/gui-not-showing/596073/1 "2015-09-03T10:28:01Z")

</div>

Hey Alright i figured out i could not use the Canvas. so i have coded the stuff for a script so like i have a barracks and coded a script for that… that will use the buttons etc… the problem is that the script compiles but the buttons do not show up…  
HUD\_Barracks.cs

```csharp
using UnityEngine;
using System.Collections;

public class HUD_Barracks : MonoBehaviour
{
    //Spawn Location
    public Transform spawn;
    public Transform goToAfterSpawn;
    //public Player
    private PlayerScript Usercube;

    //public Resources
    private Resources UserResources;
    //Icons
    public Texture2D icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, icon9, icon10, icon11, icon12, icon13, icon14, icon15, icon16, icon17, icon18;
    //drag Selection
    public bool selected = false;
    //private Vector3 moveToDest = Vector3.zero;
    public float floorOffSet = 1;
    //Click Select
    private bool selectionByClick = false;

    // Use this for initialization
    void Start ()
    { //using scripts attached to User
        GameObject user = GameObject.Find("UserCube");
        //usings Stuff from PlayerScript Script
        PlayerScript Usercube = user.GetComponent<PlayerScript>();
        //usings Stuff from Resources Script
        Resources UserResources = user.GetComponent<Resources>();
    }

    void OnGUI()
    {
        if(Usercube && Usercube.human) //checks to see if user is human
        {
            DrawButtons();
        }
    }

    // Update is called once per frame
    private void Update ()
    {      

        //Place Layer Unit Control Here.
        if (Input.GetMouseButton(0))
        {

            if (!selectionByClick)
            {
                Vector3 camPos = Camera.main.WorldToScreenPoint (transform.position);
                camPos.y = CamOP.InvertMouseY(camPos.y);
                selected = CamOP.selection.Contains (camPos);
            }
            if (selected)
            {
                gameObject.GetComponentInChildren<Projector>().enabled = true;

            }
            else
            {
                gameObject.GetComponentInChildren<Projector>().enabled = false;
            }
              
        }
    }
    //buttons for barracks
    private void DrawButtons()
    {
        // Make a group
        GUI.BeginGroup (new Rect (Screen.width - 310,Screen.height - 270,300,260));
        // All rectangles are now adjusted to the group. (0,0) is the topleft corner of the group.
      
        //(0 __PositionWidth,0__ PositionHeight,0 __BOXWidth,0__ BOXHeight)
        //Row1---------------------------------------------------------------------------------------------------------------------------------
        //Button1
        GUI.RepeatButton (new Rect (0,80,60,60), new GUIContent ("", icon1, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button2
        GUI.RepeatButton (new Rect (60,80,60,60), new GUIContent ("", icon2, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button3
        GUI.RepeatButton (new Rect (120,80,60,60), new GUIContent ("", icon3, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button4
        GUI.RepeatButton (new Rect (180,80,60,60), new GUIContent ("", icon4, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button5
        GUI.RepeatButton (new Rect (240,80,60,60), new GUIContent ("", icon5, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button6
        GUI.RepeatButton (new Rect (300,80,60,60), new GUIContent ("", icon6, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Row2---------------------------------------------------------------------------------------------------------------------------------
        //Button7
        GUI.RepeatButton (new Rect (0,140,60,60), new GUIContent ("", icon7, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button8
        GUI.RepeatButton (new Rect (60,140,60,60), new GUIContent ("", icon8, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button9
        GUI.RepeatButton (new Rect (120,140,60,60), new GUIContent ("", icon9, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button10
        GUI.RepeatButton (new Rect (180,140,60,60), new GUIContent ("", icon10, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button11
        GUI.RepeatButton (new Rect (240,140,60,60), new GUIContent ("", icon11, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button12
        GUI.RepeatButton (new Rect (300,140,60,60), new GUIContent ("", icon12, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Row3---------------------------------------------------------------------------------------------------------------------------------
        //Button13
        GUI.RepeatButton (new Rect (0,200,60,60), new GUIContent ("", icon13, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button14
        GUI.RepeatButton (new Rect (60,200,60,60), new GUIContent ("", icon14, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button15
        GUI.RepeatButton (new Rect (120,200,60,60), new GUIContent ("", icon15, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button16
        GUI.RepeatButton (new Rect (180,200,60,60), new GUIContent ("", icon16, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button17
        GUI.RepeatButton (new Rect (240,200,60,60), new GUIContent ("", icon17, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button18
        GUI.RepeatButton (new Rect (300,200,60,60), new GUIContent ("", icon18, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
      
        // End the group we started above.
        GUI.EndGroup ();
    }

    //Function for SimpleMouseClick
    private void OnMouseDown()
    {
        selectionByClick = true;
        selected = true;
    }
    private void OnMouseUp()
    {
        if (selectionByClick)
            selected = true;
      
        selectionByClick = false;
    }  

}

```

now HUD CS is where i got it working and it works fine…

```csharp
using UnityEngine;
using System.Collections;

public class HUD : MonoBehaviour {

    //public Player
    private PlayerScript User;
    //Icons
    public Texture2D icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, icon9, icon10, icon11, icon12, icon13, icon14, icon15, icon16, icon17, icon18;

    // Use this for initialization
    void Start ()
    {
        User = transform.root.GetComponent< PlayerScript >();
    }
  
    // Update is called once per frame
    void OnGUI()
    {
        if(User && User.human) //checks to see if user is human
        {
            DrawMiniMap();
            DrawResourceBar();
            DrawButtons();
        }
    }
    //Creates the OrderBar for HUD
    private void DrawMiniMap()
    {
        GUI.Box (new Rect (10,Screen.height - 110,100,100), "MiniMap");
    }
    //creates the ResourceBar for HUD
    private void DrawResourceBar()
    {
        //resources go here
    }
    private void DrawButtons()
    {

        // Make a group on the center of the screen
        GUI.BeginGroup (new Rect (Screen.width - 310,Screen.height - 270,300,260));
        // All rectangles are now adjusted to the group. (0,0) is the topleft corner of the group.

        //(0 __PositionWidth,0__ PositionHeight,0 __BOXWidth,0__ BOXHeight)
        //Row1---------------------------------------------------------------------------------------------------------------------------------
        //Button1
        GUI.RepeatButton (new Rect (0,80,60,60), new GUIContent ("", icon1, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button2
        GUI.RepeatButton (new Rect (60,80,60,60), new GUIContent ("", icon2, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button3
        GUI.RepeatButton (new Rect (120,80,60,60), new GUIContent ("", icon3, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button4
        GUI.RepeatButton (new Rect (180,80,60,60), new GUIContent ("", icon4, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button5
        GUI.RepeatButton (new Rect (240,80,60,60), new GUIContent ("", icon5, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button6
        GUI.RepeatButton (new Rect (300,80,60,60), new GUIContent ("", icon6, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Row2---------------------------------------------------------------------------------------------------------------------------------
        //Button7
        GUI.RepeatButton (new Rect (0,140,60,60), new GUIContent ("", icon7, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button8
        GUI.RepeatButton (new Rect (60,140,60,60), new GUIContent ("", icon8, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button9
        GUI.RepeatButton (new Rect (120,140,60,60), new GUIContent ("", icon9, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button10
        GUI.RepeatButton (new Rect (180,140,60,60), new GUIContent ("", icon10, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button11
        GUI.RepeatButton (new Rect (240,140,60,60), new GUIContent ("", icon11, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button12
        GUI.RepeatButton (new Rect (300,140,60,60), new GUIContent ("", icon12, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Row3---------------------------------------------------------------------------------------------------------------------------------
        //Button13
        GUI.RepeatButton (new Rect (0,200,60,60), new GUIContent ("", icon13, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button14
        GUI.RepeatButton (new Rect (60,200,60,60), new GUIContent ("", icon14, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button15
        GUI.RepeatButton (new Rect (120,200,60,60), new GUIContent ("", icon15, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button16
        GUI.RepeatButton (new Rect (180,200,60,60), new GUIContent ("", icon16, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button17
        GUI.RepeatButton (new Rect (240,200,60,60), new GUIContent ("", icon17, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button18
        GUI.RepeatButton (new Rect (300,200,60,60), new GUIContent ("", icon18, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
      
        // End the group we started above. This is very important to remember!
        GUI.EndGroup ();

    }
}

```

but the minute i try place it in the barracks script nothing…

---

<div class="post-metadata">

### Author: ![tedthebug](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/tedthebug/32/391213_2.png) [@tedthebug](https://discussions.unity.com/u/tedthebug)
#### Post date: [September 3, 2015, 11:18am UTC](https://discussions.unity.com/t/gui-not-showing/596073/2 "2015-09-03T11:18:35Z")

</div>

Do you need to add using UnityEngine.UI or is that for the canvas? Sorry, I’m not up with ui, I’m just starting to use it.

---

<div class="post-metadata">

### Author: ![anon23430162](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@anon23430162](https://discussions.unity.com/u/anon23430162)
#### Post date: [September 3, 2015, 11:23am UTC](https://discussions.unity.com/t/gui-not-showing/596073/3 "2015-09-03T11:23:27Z")

</div>

Hey bro no i dont need to because im not using the canvas…

here is the code to fix it… i found out that looking for if it was human seems to be not working… 😕

```csharp
using UnityEngine;
using System.Collections;

public class HUD_Barracks : MonoBehaviour
{
    //Spawn Location
    public Transform spawn;
    public Transform goToAfterSpawn;
    //public Player
    //private PlayerScript Usercube;

    //public Resources
    //private Resources UserResources;
    //Icons
    public Texture2D icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, icon9, icon10, icon11, icon12, icon13, icon14, icon15, icon16, icon17, icon18;
    //drag Selection
    public bool selected = false;
    //private Vector3 moveToDest = Vector3.zero;
    public float floorOffSet = 1;
    //Click Select
    private bool selectionByClick = false;

    // Use this for initialization
    void Start ()
    { //using scripts attached to User
        GameObject user = GameObject.Find("UserCube");
        //usings Stuff from PlayerScript Script
        PlayerScript Usercube = user.GetComponent<PlayerScript>();
        //usings Stuff from Resources Script
        Resources UserResources = user.GetComponent<Resources>();
    }

    void OnGUI()
    {
        if (!selected)
        {

        }

        else
        {
            DrawButtons ();
        }
    }

    // Update is called once per frame
    void Update ()
    {       

        //Place Layer Unit Control Here.
        if (Input.GetMouseButton(0))
        {

            if (!selectionByClick)
            {
                Vector3 camPos = Camera.main.WorldToScreenPoint (transform.position);
                camPos.y = CamOP.InvertMouseY(camPos.y);
                selected = CamOP.selection.Contains (camPos);
            }
            if (selected)
            {
                gameObject.GetComponentInChildren<Projector>().enabled = true;

            }
            else
            {
                gameObject.GetComponentInChildren<Projector>().enabled = false;

            }
               
        }
    }
    //buttons for barracks
    private void DrawButtons()
    {
        // Make a group on the center of the screen
        GUI.BeginGroup (new Rect (Screen.width - 310,Screen.height - 270,300,260));
        // All rectangles are now adjusted to the group. (0,0) is the topleft corner of the group.
       
        //(0 __PositionWidth,0__ PositionHeight,0 __BOXWidth,0__ BOXHeight)
        //Row1---------------------------------------------------------------------------------------------------------------------------------
        //Button1
        GUI.RepeatButton (new Rect (0,80,60,60), new GUIContent ("", icon1, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button2
        GUI.RepeatButton (new Rect (60,80,60,60), new GUIContent ("", icon2, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button3
        GUI.RepeatButton (new Rect (120,80,60,60), new GUIContent ("", icon3, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button4
        GUI.RepeatButton (new Rect (180,80,60,60), new GUIContent ("", icon4, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button5
        GUI.RepeatButton (new Rect (240,80,60,60), new GUIContent ("", icon5, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button6
        GUI.RepeatButton (new Rect (300,80,60,60), new GUIContent ("", icon6, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Row2---------------------------------------------------------------------------------------------------------------------------------
        //Button7
        GUI.RepeatButton (new Rect (0,140,60,60), new GUIContent ("", icon7, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button8
        GUI.RepeatButton (new Rect (60,140,60,60), new GUIContent ("", icon8, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button9
        GUI.RepeatButton (new Rect (120,140,60,60), new GUIContent ("", icon9, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button10
        GUI.RepeatButton (new Rect (180,140,60,60), new GUIContent ("", icon10, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button11
        GUI.RepeatButton (new Rect (240,140,60,60), new GUIContent ("", icon11, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button12
        GUI.RepeatButton (new Rect (300,140,60,60), new GUIContent ("", icon12, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Row3---------------------------------------------------------------------------------------------------------------------------------
        //Button13
        GUI.RepeatButton (new Rect (0,200,60,60), new GUIContent ("", icon13, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button14
        GUI.RepeatButton (new Rect (60,200,60,60), new GUIContent ("", icon14, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button15
        GUI.RepeatButton (new Rect (120,200,60,60), new GUIContent ("", icon15, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button16
        GUI.RepeatButton (new Rect (180,200,60,60), new GUIContent ("", icon16, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button17
        GUI.RepeatButton (new Rect (240,200,60,60), new GUIContent ("", icon17, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
        //Button18
        GUI.RepeatButton (new Rect (300,200,60,60), new GUIContent ("", icon18, "This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf This is the tooltip1 asdfasdf asdf asdf asd fas df asdf asdf asdf"));
        GUI.Label (new Rect (0,0,290,80), GUI.tooltip);
       
        // End the group we started above. This is very important to remember!
        GUI.EndGroup ();
    }

    //Function for SimpleMouseClick
    private void OnMouseDown()
    {
        selectionByClick = true;
        selected = true;
    }
    private void OnMouseUp()
    {
        if (selectionByClick)
            selected = true;
       
        selectionByClick = false;
    }   

}

```

---

<div class="post-metadata">

### Author: ![anon23430162](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@anon23430162](https://discussions.unity.com/u/anon23430162)
#### Post date: [September 3, 2015, 11:25am UTC](https://discussions.unity.com/t/gui-not-showing/596073/4 "2015-09-03T11:25:59Z")

</div>

Now the Only issue is that once i try click a button the menu goes away 😕 i think its detecting that the barracks is deselected. trying to sort it out… but lol im not a coder… so figuring as i try things…

---

<div class="post-metadata">

### Author: ![LeftyRighty](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@LeftyRighty](https://discussions.unity.com/u/LeftyRighty)
#### Post date: [September 3, 2015, 1:07pm UTC](https://discussions.unity.com/t/gui-not-showing/596073/5 "2015-09-03T13:07:03Z")

</div>

> [@Custardcs](#):
>
> Hey Alright i figured out i could not use the Canvas.

mostly out of curiosity, but why have you made that assertion? a quick skim of the code doesn’t seem to show anything that the newer canvas approach couldn’t support.

(ignoring the “too far down the path to change forks now” :P)

---

<div class="post-metadata">

### Author: ![Suddoha](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/suddoha/32/110358_2.png) [@Suddoha](https://discussions.unity.com/u/Suddoha)
#### Post date: [September 3, 2015, 1:34pm UTC](https://discussions.unity.com/t/gui-not-showing/596073/6 "2015-09-03T13:34:43Z")

</div>

> [@Custardcs](#):
>
> Now the Only issue is that once i try click a button the menu goes away 😕 i think its detecting that the barracks is deselected. trying to sort it out… but lol im not a coder… so figuring as i try things…

You have to analyze what’s happening there.  
I assume you mean the buttons when you’re talking about the menu.

They will only be drawn when ‘selected’ is true. Now check your code, where could ‘false’ be assigned to that variable?  
Maybe here:

```csharp
if (!selectionByClick)
{
    Vector3 camPos = Camera.main.WorldToScreenPoint(transform.position);
    camPos.y = CamOP.InvertMouseY(camPos.y);
    selected = CamOP.selection.Contains (camPos);
}

```

Add a Debug.Log(selected); after those three lines. What does it print?

Also, it will be a pain to maintain the code, with all the positions etc.  
Try to look into loops and arrays. Work with offset-variables.

---

<div class="post-metadata">

### Author: ![anon23430162](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@anon23430162](https://discussions.unity.com/u/anon23430162)
#### Post date: [September 3, 2015, 4:56pm UTC](https://discussions.unity.com/t/gui-not-showing/596073/7 "2015-09-03T16:56:11Z")

</div>

> [@LeftyRighty](#):
>
> mostly out of curiosity, but why have you made that assertion? a quick skim of the code doesn’t seem to show anything that the newer canvas approach couldn’t support.
> 
> (ignoring the “too far down the path to change forks now” :p)

HAHA na bud i posted a while back here asking for help an had 300 people read it and just not reply… eventually i just did what i could and came up with this…  
once it is working i can just apply each script to each building even if it is a long way around… i am not a coder… i am an artist. lol.

> [@Suddoha](#):
>
> You have to analyze what’s happening there.  
> I assume you mean the buttons when you’re talking about the menu.
> 
> They will only be drawn when ‘selected’ is true. Now check your code, where could ‘false’ be assigned to that variable?  
> Maybe here:
> 
> ```csharp
> if (!selectionByClick)
> {
> Vector3 camPos = Camera.main.WorldToScreenPoint(transform.position);
> camPos.y = CamOP.InvertMouseY(camPos.y);
> selected = CamOP.selection.[URL='http://unity3d.com/support/documentation/ScriptReference/30_search.html?q=Contains']Contains[/URL] (camPos);
> }
> 
> ```
> 
> Add a Debug.Log(selected); after those three lines. What does it print?
> 
> Also, it will be a pain to maintain the code, with all the positions etc.  
> Try to look into loops and arrays. Work with offset-variables.

well bud to me you are honestly speaking about stuff i am not aware of or do not know how to use… i can basically read and understand some of peoples code/ explanations…

but ill see if i can maybe read that link you sent me… and find something…

---

<div class="post-metadata">

### Author: ![Suddoha](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/suddoha/32/110358_2.png) [@Suddoha](https://discussions.unity.com/u/Suddoha)
#### Post date: [September 3, 2015, 5:12pm UTC](https://discussions.unity.com/t/gui-not-showing/596073/8 "2015-09-03T17:12:35Z")

</div>

> [@Custardcs](#):
>
> HAHA na bud i posted a while back here asking for help an had 300 people read it and just not reply… eventually i just did what i could and came up with this…  
> once it is working i can just apply each script to each building even if it is a long way around… i am not a coder… i am an artist. lol.
> 
> well bud to me you are honestly speaking about stuff i am not aware of or do not know how to use… i can basically read and understand some of peoples code/ explanations…
> 
> but ill see if i can maybe read that link you sent me… and find something…

I fixed the link which was somehow placed in the code, i assume that happened because i copied the code snippet from the post without qouting it.  
Anyway, all i recommended in regards to the problem was adding one line to your current code, this one: Debug.Log(selected);  
The other suggestions about arrays etc. are just for you to look up, they have nothing to do with the actual problem but might help to reduce your method to about 4-5 lines and you could maintain the code much easier then.

---

<div class="post-metadata">

### Author: ![anon23430162](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@anon23430162](https://discussions.unity.com/u/anon23430162)
#### Post date: [September 3, 2015, 5:14pm UTC](https://discussions.unity.com/t/gui-not-showing/596073/9 "2015-09-03T17:14:58Z")

</div>

i guess i could try using (GuiContent.GuiContent) but not sure how i am going to put it to use there is nothing really helping with showing me how it is used.

---

<div class="post-metadata">

### Author: ![anon23430162](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@anon23430162](https://discussions.unity.com/u/anon23430162)
#### Post date: [September 3, 2015, 5:25pm UTC](https://discussions.unity.com/t/gui-not-showing/596073/10 "2015-09-03T17:25:00Z")

</div>

this is the debug error i got bro

 ![2279246--153007--Capture.JPG](https://europe1.discourse-cdn.com/unity/original/4X/c/e/1/ce10982be762d0fff9b845a056a0042477d9db4f.jpeg)

---

<div class="post-metadata">

### Author: ![Suddoha](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/suddoha/32/110358_2.png) [@Suddoha](https://discussions.unity.com/u/Suddoha)
#### Post date: [September 3, 2015, 5:44pm UTC](https://discussions.unity.com/t/gui-not-showing/596073/11 "2015-09-03T17:44:51Z")

</div>

> [@Custardcs](#):
>
> this is the debug error i got bro

See, now you’re a bit closer to the cause of the problem.  
The method returns false and will be executed when you click your mousebutton due to the if statement i quoted above. Thus, your menu will disappear (it’s only drawn when selected is true).

And now you have to dig further, what’s CamOP.selection? Probably a collection of any kind (List, ArrayList, Set,…) containing Vector3 values.  
The method Contains() searches through that collection and tries to find a match (match means, one object has to be equal to the other, the definition of equality depends on the type as you can override it). If it finds one, it will return true, otherwise false. Latter one happens, because the vectors are probably compared component by component, each component being a float. And float value comparisons are not good at all if not properly done. Don’t rely on that.

---

<div class="post-metadata">

### Author: ![anon23430162](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@anon23430162](https://discussions.unity.com/u/anon23430162)
#### Post date: [September 3, 2015, 7:54pm UTC](https://discussions.unity.com/t/gui-not-showing/596073/12 "2015-09-03T19:54:13Z")

</div>

Sorry was at gym… umm here is my CAMOP script so you can better understand…

```csharp
using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class CamOP : MonoBehaviour
{
    //Reference to player
    private PlayerScript User;

    //Drag Select
    public Texture2D SelectionHightLight = null;
    public static Rect selection = new Rect(0, 0, 0, 0);
    private Vector3 StartClick = -Vector3.one;
   

    //Move To
    private static Vector3 moveToDestination = Vector3.zero;
    private static List<string> passables = new List<string>() { "Terrain" }; //Make Sure To Name the Terrain Floor

    //On Start Find Player
    void Start()
    {
        User = transform.root.GetComponent< PlayerScript >();
    }
    // Update is called once per frame
    void Update ()
    {
        if(User.human) //checks to see if user is HUMAN
        {
            CheckCamera ();   
            Cleanup ();
        }
    }

    //Setting up the drag box selection
    private void CheckCamera()
    {
        if (Input.GetMouseButtonDown (0))
            StartClick = Input.mousePosition;
        else if (Input.GetMouseButtonUp(0))
            StartClick = -Vector3.one;

        if (Input.GetMouseButton (0))
        {
            selection = new Rect (StartClick.x, InvertMouseY (StartClick.y), Input.mousePosition.x - StartClick.x, InvertMouseY (Input.mousePosition.y) - InvertMouseY (StartClick.y));

            if (selection.width < 0)
            {
                selection.x += selection.width;
                selection.width = -selection.width;
            }
            if (selection.height < 0)
            {
                selection.y += selection.height;
                selection.height = -selection.height;
            }
        }

    }

    //Drag Box Creation
    private void OnGUI()
    {
        if (StartClick != -Vector3.one)
        {
            GUI.color = new Color(1, 1, 1, 0.5f);
            GUI.DrawTexture(selection, SelectionHightLight);
        }
    }

    public static float InvertMouseY(float y)
    {
        return Screen.height - y;
    }

    private void Cleanup()
    {
        if (!Input.GetMouseButtonUp (1))
            moveToDestination = Vector3.zero;
    }

    public static Vector3 GetDestination()
    {
        if (moveToDestination == Vector3.zero)
        {
            RaycastHit hit;
            Ray r = Camera.main.ScreenPointToRay(Input.mousePosition);

            if (Physics.Raycast (r, out hit))
            {
                while (!passables.Contains (hit.transform.gameObject.name))
                {
                    if (!Physics.Raycast(hit.point + r.direction * 0.1f, r.direction, out hit))
                        break;
                }
            }

            if (hit.transform != null)
                moveToDestination = hit.point;
        }

        return moveToDestination;
    }
}

```

Like i said but i usually follow tutorials as i understand probably the bare minimum… then i try and recreate what they do without copying anything down and if i get stuck I check myself… this out of all the tutorials was the best one i found with regards to selecting a unit and telling it to move…

---

<div class="post-metadata">

### Author: ![Suddoha](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/suddoha/32/110358_2.png) [@Suddoha](https://discussions.unity.com/u/Suddoha)
#### Post date: [September 3, 2015, 8:28pm UTC](https://discussions.unity.com/t/gui-not-showing/596073/13 "2015-09-03T20:28:45Z")

</div>

> [@Custardcs](#):
>
> Sorry was at gym… umm here is my CAMOP script so you can better understand…
> 
> ```csharp
> using UnityEngine;
> using System.Collections;
> using System.Collections.Generic;
> 
> public class CamOP : MonoBehaviour
> {
> //Reference to player
> private PlayerScript User;
> 
> //Drag Select
> public Texture2D SelectionHightLight = null;
> public static Rect selection = new Rect(0, 0, 0, 0);
> private Vector3 StartClick = -Vector3.one;
>   
> 
> //Move To
> private static Vector3 moveToDestination = Vector3.zero;
> private static List<string> passables = new List<string>() { "Terrain" }; //Make Sure To Name the Terrain Floor
> 
> //On Start Find Player
> void Start()
> {
> User = transform.root.GetComponent< PlayerScript >();
> }
> // Update is called once per frame
> void Update ()
> {
> if(User.human) //checks to see if user is HUMAN
> {
> CheckCamera ();  
> Cleanup ();
> }
> }
> 
> //Setting up the drag box selection
> private void CheckCamera()
> {
> if (Input.GetMouseButtonDown (0))
> StartClick = Input.mousePosition;
> else if (Input.GetMouseButtonUp(0))
> StartClick = -Vector3.one;
> 
> if (Input.GetMouseButton (0))
> {
> selection = new Rect (StartClick.x, InvertMouseY (StartClick.y), Input.mousePosition.x - StartClick.x, InvertMouseY (Input.mousePosition.y) - InvertMouseY (StartClick.y));
> 
> if (selection.width < 0)
> {
> selection.x += selection.width;
> selection.width = -selection.width;
> }
> if (selection.height < 0)
> {
> selection.y += selection.height;
> selection.height = -selection.height;
> }
> }
> 
> }
> 
> //Drag Box Creation
> private void OnGUI()
> {
> if (StartClick != -Vector3.one)
> {
> GUI.color = new Color(1, 1, 1, 0.5f);
> GUI.DrawTexture(selection, SelectionHightLight);
> }
> }
> 
> public static float InvertMouseY(float y)
> {
> return Screen.height - y;
> }
> 
> private void Cleanup()
> {
> if (!Input.GetMouseButtonUp (1))
> moveToDestination = Vector3.zero;
> }
> 
> public static Vector3 GetDestination()
> {
> if (moveToDestination == Vector3.zero)
> {
> RaycastHit hit;
> Ray r = Camera.main.ScreenPointToRay(Input.mousePosition);
> 
> if (Physics.Raycast (r, out hit))
> {
> while (!passables.Contains (hit.transform.gameObject.name))
> {
> if (!Physics.Raycast(hit.point + r.direction * 0.1f, r.direction, out hit))
> break;
> }
> }
> 
> if (hit.transform != null)
> moveToDestination = hit.point;
> }
> 
> return moveToDestination;
> }
> }
> 
> ```
> 
> Like i said but i usually follow tutorials as i understand probably the bare minimum… then i try and recreate what they do without copying anything down and if i get stuck I check myself… this out of all the tutorials was the best one i found with regards to selecting a unit and telling it to move…

Okay that was a wrong guess with the collection, it’s a Rectangle. 😛  
So you want to do some kind of unit selection i guess.

In order to find out what’s going wrong, you should add some more Debug.Logs to your script or even better, as you have to compare values now, make OnGUI draw some labels and make them display the following values:

- CamOP.selection: position/coordinates and its size
- camPos (which is the transforms position in screen space)

Then, have a look at the values that will be shown.

---

<div class="post-metadata">

### Author: ![tedthebug](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/tedthebug/32/391213_2.png) [@tedthebug](https://discussions.unity.com/u/tedthebug)
#### Post date: [September 3, 2015, 8:37pm UTC](https://discussions.unity.com/t/gui-not-showing/596073/14 "2015-09-03T20:37:49Z")

</div>

Have you checked out PlayMaker? A bit expensive but artists I know like it as it makes scripting visual (you still need a basic understanding though) & all the links/nodes let you see where the code is up to while it is running.

Sorry, I can’t actually help with the issue but thought I’d mention it in case you hadn’t heard of it.

---

<div class="post-metadata">

### Author: ![anon23430162](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@anon23430162](https://discussions.unity.com/u/anon23430162)
#### Post date: [September 4, 2015, 7:47am UTC](https://discussions.unity.com/t/gui-not-showing/596073/15 "2015-09-04T07:47:55Z")

</div>

> [@Suddoha](#):
>
> Okay that was a wrong guess with the collection, it’s a Rectangle. 😛  
> So you want to do some kind of unit selection i guess.
> 
> In order to find out what’s going wrong, you should add some more Debug.Logs to your script or even better, as you have to compare values now, make OnGUI draw some labels and make them display the following values:
> 
> - CamOP.selection: position/coordinates and its size
> - camPos (which is the transforms position in screen space)
> 
> Then, have a look at the values that will be shown.

sorry bud i am little confused… what you mean? what do i have to compare?

hmm ill create a label and place the vales in there… but what is it that you are looking for?

> [@tedthebug](#):
>
> Have you checked out PlayMaker? A bit expensive but artists I know like it as it makes scripting visual (you still need a basic understanding though) & all the links/nodes let you see where the code is up to while it is running.
> 
> Sorry, I can’t actually help with the issue but thought I’d mention it in case you hadn’t heard of it.

Yea bud i have heard its like unreals VS but the issue is that you have to learn a whole new thing and keeps you from making it the way you want…

---

<div class="post-metadata">

### Author: ![anon23430162](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@anon23430162](https://discussions.unity.com/u/anon23430162)
#### Post date: [September 4, 2015, 8:14am UTC](https://discussions.unity.com/t/gui-not-showing/596073/16 "2015-09-04T08:14:38Z")

</div>

lol the issues are real… 😕

 ![2280090--153080--Capture.JPG](https://europe1.discourse-cdn.com/unity/original/4X/6/4/1/64171e6be12b95f17db028500e787c8358b4e1b0.jpeg)

if its referencing another script…? wouldnt i use the other ones i have defined?

---

<div class="post-metadata">

### Author: ![Suddoha](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/suddoha/32/110358_2.png) [@Suddoha](https://discussions.unity.com/u/Suddoha)
#### Post date: [September 4, 2015, 8:52am UTC](https://discussions.unity.com/t/gui-not-showing/596073/17 "2015-09-04T08:52:27Z")

</div>

> [@Custardcs](#):
>
> lol the issues are real… 😕

You have to put CamOP.selection in there, that should already print the coordinates and the size.  
Sorry if that confuses you alot, but you’re supposed to compare the values written to the labels:

- the rect of the selection window that you are creating with your mouse
- the screen space position of your transform

Why? Because you calculate the screen space position of the transform that holds the HUD\_Barracks script, for example 500,400. And you calculate a rectangle that you create for box-selection which has to contain this position. Otherwise you’ll get false from the Contains() that method i mentioned in previous posts.

There will be problems with this script i guess, but that’s not the point at the moment. And it makes it really hard to find the point of failure because everything seems to tightly coupled and dependant on each other.

---

<div class="post-metadata">

### Author: ![anon23430162](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@anon23430162](https://discussions.unity.com/u/anon23430162)
#### Post date: [September 4, 2015, 10:52am UTC](https://discussions.unity.com/t/gui-not-showing/596073/18 "2015-09-04T10:52:44Z")

</div>

umm would it be better for me to send you the project? so you can test it out yourself? or do you just need me to place what you required in?

---

<div class="post-metadata">

### Author: ![anon23430162](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@anon23430162](https://discussions.unity.com/u/anon23430162)
#### Post date: [September 4, 2015, 11:03am UTC](https://discussions.unity.com/t/gui-not-showing/596073/19 "2015-09-04T11:03:24Z")

</div>

Any thing i try it fails to compile…

i have tried

```csharp
GUI.Label (new Rect (0,0,290,80), CamOP.selection);

GUI.Label (new Rect (0,0,290,80), selection);

GUI.Label (new Rect (0,0,290,80), selected);

GUI.Label (new Rect (0,0,290,80), CamOP.selection.contains);

```

is there maybe a way to make it stop returning false when it has anything with GUI in it?

---

<div class="post-metadata">

### Author: ![Suddoha](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/suddoha/32/110358_2.png) [@Suddoha](https://discussions.unity.com/u/Suddoha)
#### Post date: [September 4, 2015, 11:21am UTC](https://discussions.unity.com/t/gui-not-showing/596073/20 "2015-09-04T11:21:24Z")

</div>

> [@Custardcs](#):
>
> Any thing i try it fails to compile…
> 
> i have tried
> 
> ```csharp
> GUI.Label (new Rect (0,0,290,80), CamOP.selection);
> 
> GUI.Label (new Rect (0,0,290,80), selection);
> 
> GUI.Label (new Rect (0,0,290,80), selected);
> 
> GUI.Label (new Rect (0,0,290,80), CamOP.selection.contains);
> 
> ```
> 
> is there maybe a way to make it stop returning false when it has anything with GUI in it?

You could send me the project, however, it will be the best if you take part in finding the solution.

Add .ToString() to CamOP.selection so that it reads CamOP.selection.ToString(), sorry for all the small things that I leave out. The Label requires GuiContent or a string, that’s why you have to call ToString() in this case or concatenate it with another (empty) string. ToString() is better though.

[Next page](https://discussions.unity.com/t/gui-not-showing/596073.md?page=2)
