Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

How Should I Handle Items

Discussion in 'Scripting' started by CobaltTheFox, Feb 20, 2019.

  1. CobaltTheFox

    CobaltTheFox

    Joined:
    May 29, 2015
    Posts:
    27
    I am working on a game and we are planning on having a lot of items. Obviously this is a lot of data that I would like to have organized and easily accessible. Every item would have to have variables to handle: item ids, stacking limits, ect. What is the best way to organize this so that I can keep it constant across all scenes, so that I could easily spawn these items into the game without hassle.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,951
    There's lots of tutorials to give you ideas but you won't develop a good sense for it until you actually try your own approach, even if it is derived straight from a tutorial.

    Also, I recommend learning how to use ScriptableObjects because those are a great way to define lots of uniform content in Unity, content that anyone on your team using the Unity editor can change without knowing how to code.
     
  3. CobaltTheFox

    CobaltTheFox

    Joined:
    May 29, 2015
    Posts:
    27
    Thank you, I'll take a look at those.