How can I create an Inventory system with GUI?

Hi Everyone!

I've just started on my first video game made in unity. But i really need some help!. Can somebody send me a project or a tutorial on how to make a bag like gui? (i.e. an inventory system). Like to keep items in and be able to equip them from that area?.

Thanks in advance!

more ▼

asked Feb 04, 2010 at 04:39 PM

avatar image

31 21 20 24

Here is a great tutorial, that show you exactly how to do it: https://www.youtube.com/watch?v=KLaGkc87dDQ

Jan 17 at 05:50 PM Artifactx
(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

I just finished implementing a complex inventory/skills/hotbar system to my RPG, and while such a task is far too monumental to explain in a post, I can give you some tips.

  • First, don't use GUI.Button(). It probably includes more functionality than you need. When I prototyped the inventory system with ~30 buttons, my framerate dropped by 100fps! Instead, try to write your own coordinate system and clicking system. "IsInRectangle()" is a great custom function to have. I know it will be a lot of work, but hey, I saved 100fps by doing it.

  • Figure out what all you want it to do -- explicitly -- so that you won't have to change things later. This is a very intricate programming task, so you'll need to not make changes.

  • To save cpu cycles, you generally want to first check if the menus are open, then if the player's mouse is inside a selectable area, then do the calculations to figure out what the mouse is over and what to do if the mouse is clicked.

more ▼

answered Feb 04, 2010 at 11:31 PM

avatar image

1k 19 59 74

can you post it on a site plz so i can copy type it? ( srry im dutch i didnt knew the word for it! :P)

Apr 15, 2010 at 07:02 AM DarkHype

Hello CJCurrie, thanks for those tips, generally you used the GUI class, is there any other majority classes that did you use on you inventory? I would like to read more about those. thanks.

Apr 16, 2010 at 03:37 AM Albert
(comments are locked)
10|3000 characters needed characters left

Creating a functioning inventory system is probably too large a task to be answered in a single question here, and would largely be specific to how the rest of your game was constructed.

However, you can use this Custom Google Unity3D search to search for the word "inventory". When I tried this, 9 of the first 10 results look like they are specifically to do with implementing Inventory systems in Unity:

Custom Unity3D Google Search

Custom Unity3D Search results for "Inventory"

more ▼

answered Feb 04, 2010 at 09:11 PM

avatar image

duck ♦♦
50.5k 146 398 543

i dont know if you're going to see this, but i learn from examples. I was wondering if you know where a project file is with an inventory system that i could download and look at to kinda figure it out?

Feb 15, 2010 at 05:16 AM Adam Bruns

DUCK DUDE, it's the fifth time i read the same sh*tty comment of you. you are helping noone and it seems that you collecting posts. if you don't have a piece of code or something just STFU.

Aug 08, 2011 at 02:24 PM kabel

@Kabel Says the guy who hasn't helped a single person yet? Duckets has helped literally thousands of people on this site, and he is absolutely correct in pointing out that this is a poor question - there is no 'one' solution to it, there are a ton of ways to go and it has been answered before several times. So perhaps focus a bit more on helping others (or at least asking proper questions, what the hell was that?) then on critiquing those who do.

Aug 08, 2011 at 02:35 PM Joshua

@kabel Wow. Just wow. Marvels at how obnoxious a person can be. To pick on the second most helpful person on the site. Being new is no excuse for something like that, by contrast. Shakes head in sheer disbelieve

Told you already: Fix your attitude or leave.

Greetz, Ky.

Aug 08, 2011 at 03:08 PM SisterKy

Thanks for tip. I didnt know about Custom Unity3D Google Search.

Aug 21, 2012 at 08:49 PM chelnok
(comments are locked)
10|3000 characters needed characters left
more ▼

answered Jun 05, 2011 at 02:43 PM

avatar image

474 81 67 78

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments



asked: Feb 04, 2010 at 04:39 PM

Seen: 28046 times

Last Updated: Jan 17 at 05:50 PM