I have no idea what these errors mean and PLEASE don't criticize me for how "easy" these are, im not in the mood...:'( All on line 12 W hile hovering over the 'Add' function, Monodevelop states "Unknown Resolve Error" This is a Inventory system and im trying to add a item to the inventory when the stated events happen. Code (csharp): //-----------------------------Interaction Script---------------------------------- void ObtainItem(){ _playerInventory = GetComponent<PlayerInventory>(); if (_worldItemProperties.ItemQuantity > 1) { Interaction.text = "Obtained " + _worldItemProperties.ItemQuantity + _worldItemProperties.ItemName + "s!"; Debug.Log ("Obtained " + _worldItemProperties.ItemQuantity + " " + _worldItemProperties.ItemName + "s!"); if (_worldItemProperties.Respawn) { _playerInventory.Inventory.Add(_worldItemProperties.ItemName); //This line adds a item when player presses a button _worldItemProperties.gameObject.SetActive (false); } } } //-----------------------------------WorldItemPropertiesScript-------------------------- public string ItemName = "Cookies"; //-------------------------------PlayerInventory------------------------------------- public class PlayerInventory : MonoBehaviour { //BergZerg Arcade Inventory tutorial 1 has been followed for the following result private static List<WorldItemProperties> _inventory = new List<WorldItemProperties>(); public static List<WorldItemProperties> Inventory { get{ return _inventory;} } } Please State if the following errors were easy or not and how you knew how to fix, im desperate...
error CS0176: Static member `PlayerInventory.Inventory' cannot be accessed with an instance reference, qualify it with a type name instead Like the message says, the "Inventory" member of the PlayerInventory class has been declared as static here: Code (csharp): public static List<WorldItemProperties> Inventory { That basically means that it belongs to the class itself, not to an instance of the class. Since _playerInventory is an *instance* of the PlayerInventory class, you can't use it to access the Inventory member. Instead, you need to reference it like: Code (csharp): PlayerInventory.Inventory // note the *class* name is being used here, not an *instance* name The CS1502 and CS1503 errors are both caused by the same issue. That is, the Inventory member is defined as a List of WorldItemProperties here: Code (csharp): public static List<WorldItemProperties> Inventory { So, you can only "Add" a WorldItemProperty to Inventory. That's not what you're doing here: Code (csharp): _playerInventory.Inventory.Add(_worldItemProperties.ItemName); You're trying to add an "ItemName" instead, which according to the error is a *string*. That's not going to work... Jeff