Quantcast
Channel: Questions in topic: "exception"
Viewing all articles
Browse latest Browse all 470

unity c# - IndexOutOfRangeException

$
0
0
So I made a little game that has a problem. As soon as I load the game, I get errors. **Lots of them.**![alt text][1] [1]: /storage/temp/77497-theerror.jpg I can't seem to find the problem in this code: //This is where the exception is Touch touch = Input.touches [0]; float TouchTime; if (touch.phase == TouchPhase.Began) { TouchTime = Time.time; } if (touch.phase == TouchPhase.Ended || touch.phase == TouchPhase.Canceled) { if (Time.time - TouchTime <= 0.5) { //response to tap print (""); } else { print ("Long press was" + TouchTime + "seconds long."); } } Also this was in the `update()` method, which might explain the huge number of errors, but how do I fix this?

Viewing all articles
Browse latest Browse all 470

Trending Articles



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