0
Answered

GetTouch, out of index error

Jeremy Berger 2 years ago updated 2 years ago 2

Hi, when using getTouch on Update, I get the out of index error.. how can I fix that? There is absolutely no tutorial on touch inputs for Bolt anywhere. 

Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
GOOD, I'M SATISFIED
Satisfaction mark by Jeremy Berger 2 years ago
Answered

Hi Jeremy!

Sorry you're having this issue. There is no specific touch inputs tutorial because this is a Unity concept, nothing Bolt specific.

Which index are you passing for the input? 0, 1?

According to this post on Unity answers, you should make sure the touch array is not empty:

https://answers.unity.com/questions/25223/index-out-of-bounds.html

So in Bolt:

+2

Ha! Now I understand, I knew I needed to put the touch count somewhere but couldn't find the right way to put it in the graph. Thank you it solved the issue! Cheers from Montréal, j'adore votre plugin :D!