I've the strange problem, that a certein String is causing trouble when it is called from another script.
If it is called by: if (StoredObject.GetComponent(ItemDefinition).ItemPurpose == "Cooking"){
and the string is: ItemPurpose == "Cooking" => game crashs with "NullReferenceException: Object reference not set to an instance of an object"
Is it called by: if (StoredObject.GetComponent(ItemDefinition).ItemPurpose == "Tank"){
and the string is changed (in the same script) to: ItemPurpose == "Tank" => it works!
All scripts are attached where they should, it worked bevore correctly, i didn't changed anything!
I've tried "Sync MonoDeveloop Project" and "Break Prefab Instance", also creating the Object new from scratch. What to do?
↧