• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by blits2000 · Feb 19, 2015 at 03:17 PM · instantiateinventoryactivateequip

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

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image spiceboy9994 · Feb 19, 2015 at 03:32 PM 1
Share

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.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

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

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

How to keep health from going over 100% when heath pickup is used and why does the item effect stop working after I instantiate it from the vendor. 2 Answers

picking up and wearing armour 1 Answer

New GUI and Inventory problem. 1 Answer

Trouble working with a Custom class, JavaScript. 2 Answers

Can't find an argument that corresponds to a formal parameter for a function 2 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges