Question by
tronuo · Feb 01, 2017 at 07:39 PM ·
guigameobjectover
Problems with positioning GUI rectangle and GameObject
public Color backgroundColor;
public GameObject gameObject;
// Use this for initialization
void Start () {
Instantiate (gameObject, new Vector3(15, 10, 0), Quaternion.identity);
}
void OnGUI(){
EditorGUI.DrawRect (new Rect (10, 10, Screen.width - 20, Screen.height - 20), backgroundColor);
}
Hi all. This is my code. I have a problem. Rectangle is shown over gameobject. I need that rectangle is shown behind gameobject. How is it do? Thank you.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612110117im_/https://answers.unity.com/themes/thub/images/avi.jpg)