Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

A certain string is causing trouble! (Javascript)

$
0
0
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?

Viewing all articles
Browse latest Browse all 1875

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>