I think the question is pretty self explanatory. I have two buttons that appear at the cursor position when something else is right clicked (I’m using the Brackey’s inventory system, C# edition). So when I click on an item in the inventory, I want the buttons to show up. And they do, but they show up underneath the inventory. I can still click them and everything, but that’s not exactly what I want. I want the buttons appearing over the GUI window that is the inventory. Here is the script I’m using to make my buttons appear, in case that’s important:
void OnGUI(){
if (askQuestion == true){
if (!mousePosHasBeenSet){
mousePos = Event.current.mousePosition;
mousePosHasBeenSet = true;
}
//Debug.Log ("askQuestion is " + askQuestion);
//GUI.Box(new Rect(mousePos.x, mousePos.y, 25, 25), questionToAsk);
//Debug.Log ("mouesPos y is " + mousePos.y);
//Debug.Log ("The real y mousePosition is " + Input.mousePosition.y);
if(GUI.Button(new Rect(mousePos.x, mousePos.y, 150, 20), yesString)){
selectedYes = true;
doDroppingOption ();
}
if(GUI.Button(new Rect(mousePos.x, mousePos.y + 20, 150, 20), noString)){
selectedYes = false;
doDroppingOption();
}
}
}
And here is a picture showing what I’m talking about:
[29944-stupid+gui+buttons.png|29944]
Super big thanks to anybody who offers help! All I need is to get those buttons to appear OVER the inventory window (which is a GUI.Window), rather than under.