- Home /
Inventory System- Best to Instantiate or Activate equipped items?
Hello, I have created an Inventory system and I am wanting to make the equipped item appear in front of the camera (the game is in 1st person). Should I create all the objects and just activate the one I need and disable the ones I don't (so all the items are there but only one will be visible at a time) or should I instantiate the one I need and destroy the the ones I don't? If both these ideas are hopeless please tell me. Thx
I'm working exactly on the same component for a game and I can let you know my plan about how I'm going to do that (as a suggestion):
-Read the inventory when the game loads from an xml. -Store the inventory as a singleton array -Create a prefab called InventoryItem with an script attached including the stats to modify when item is equiped -Add a method to it to unequip / equip item to modify player stats.
In my particular case, I'm not destroying the objects for the inventory since my game scenes are really simple and small. I plan to have several small scenes and load them as required. If this is the case, you could use this as suggestion.