A certain string is causing trouble! (Javascript)
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?
EDIT: I've tried to call the same string from the same object with the same command line from another script. Works!
I hope someone's know anything...
Your answer
Follow this Question
Related Questions
I really need help with this message 0 Answers
Help with JS script 0 Answers
Format Exception when trying to parseFloat(String) 2 Answers
JS NullReferenceException: Object reference not set to an instance of an object 1 Answer
NullReferenceException: Object reference not set to an instance of an object 1 Answer