Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

How can I assign one variable to multiple objects with different variables

Discussion in 'Scripting' started by TechDog, Jan 2, 2017.

  1. TechDog

    TechDog

    Joined:
    Dec 30, 2016
    Posts:
    1
    Hey everyone
    I'm working on my first Project ever with Unity 3D This game has some simularity to Plague Inc. In my Game there is a world map (which I made with Blender) and each Country has the same variable (eg. Money or Population) with different values, how should I write a script (JavaScript or C#) to assign that same variable to every Country but each Country has individual values?

    TechDog
     
  2. gorbit99

    gorbit99

    Joined:
    Jul 14, 2015
    Posts:
    1,175
    If you're using C# you should create a class, that stores these values, and you're done
    But it seems like you've never done programming before, if that's the case, please learn C# before attempting unity
    Here's a helpful link to get you started: learncs.org
     
    TaleOf4Gamers likes this.
unityunity