- Home /
Create usable item with Brackeys inventory
Hey guys! I'm trying to make a survival game and i'm with some difficult to set up my inventory. Since i'm new to scripting i'm using Brackeys inventory system (found on the asstes store: https://www.assetstore.unity3d.com/#/content/10384 and i can't make a usable item, like a can of food to regenerate my health.
I know i need to put something like
if (healthfod == used) { health += 20; }
Or something like that, but my biggest problem is to setup everything with the system. Because i need to check if it's a food, drink, antibiotic, etc.. and call the specific function for each item to affect my player.
As i said before, i'm new to scripting and also in the community, i've been looking for a answer here for a week and couldn't find it.
If anyone can help me or give me some tutorials on how to do it, that will be awesome =D Thanks guys
did you ever figure it out? Ive been trying to get it to work all week as well.... Brackeys really needs to make that video explaining how to do it like he promised, ins$$anonymous$$d of starting a new series on a 2D game...
if you still need to help with this, I got it to work. (assu$$anonymous$$g you are following brackey's tutorials as well.)
Answer by cansit · May 28, 2014 at 06:45 PM
Create a enum of itemtype hpPotion, manaPotion in Item.js then, go to ItemEffect.js, get the item.js component and, in the line of the effect check if (enum from item.js = hpPotion) hp += 20 if (enum from item.js = manaPotion) mana + 20 and so on...
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Inventory AddItem help 1 Answer
Deleting item from inventory system... 1 Answer
How to combine items in inventory with words 0 Answers
Unable to usem item from inventory 1 Answer