- Home /
In what way can I make a GUI Inventory?
I would like to be able to have interactable objects that I can pick up and go straight to the inventory(pause menu). ie: ammo, health items, weapons, keys, etc. I've been trying to figure out a way to have it so that it is a popup window, but I have no idea how to make it so that i have item textures that are all a specific size that snap to a grid and have limited space within the inventory. The partial script I have so far:
var customStyle : GUIStyle;
private var windowRect : Rect = Rect(Screen.width/2, Screen.height/2, Screen.width, Screen.height);
// Would it be an Update function or OnGUI or something else to start? I have no clue what I am doing.
function Update()
{
if(Input.GetKeyDown(KeyCode.I))
{
if(Time.TimeScale == 1)
Time.TimeScale = 0;
GUI.Window(0,windowRect,WindowFunction, "Pause Menu");
}
}
function WindowFunction()
{
}
I would also like to have it carry over from scene to scene. Does anyone have any ideas that can help?
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613082953im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Picking up an object 2 Answers
Storing items in inventory 1 Answer
Help making premade Items for farming game 2 Answers