Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

Getting a Object reference not set to an instance of an object

$
0
0
CAN SOMEONE PLEAAASE HELP Hay guys, Now first of all I know this code is hideously hard coded, but this is a prototype to test some functionality, I can't seem to get past this error... I have commented out the instantiating of the prefabs so the error seems to be in the for loop. public void checkEq() { for (int i = 0; i < 4 ; i++) { if (stage1[i].Contains("x")) { Debug.Log("xpass"); // Instantiate(tri, new Vector3(polarityGame, 0, 0), Quaternion.identity); } if (stage1[i].Contains("y")) { Debug.Log("ypass"); // Instantiate(quad, new Vector3(polarityGame, 0, 0), Quaternion.identity); } if (stage1[i].Contains("1") || stage1[i].Contains("2") || stage1[i].Contains("3") || stage1[i].Contains("4") || stage1[i].Contains("5")) { Debug.Log("numpass"); // Instantiate(circle, new Vector3(polarityGame, 0, 0), Quaternion.identity); } if (stage1[i].Contains("=")) { polarityGame = polarityGame * -1; } polarityGame = polarityGame + 1 * polarityGame; } }

Viewing all articles
Browse latest Browse all 7934

Trending Articles



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