How use Input Get touch

Alexandr Paderin 4 years ago updated by Lazlo Bonin (Lead Developer) 3 years ago 5
Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):


The default type contains touch...

The default type contains touch...

I'm trying to do this, but every time I get an error "Index out of bounds". Any ideas how to proceed?

Ok then, I've solved it.
The main problem that I was having is that I've wanted to move an object getting position from where I touch the Screen. Looking at the Unity Documentation, I've transcribed the code to Bolt platform.
The reason that I was getting a "index out of bounds" was because I was not verifying if the user has touched the screen. After that, I've made an variable of speed, and put it on the object, because, without it, the object would go crazy fast to anywhere on the screen. So, here it is.

Hi Guilherme, have a look at this post on Unity Answers:


Basically, you should add a condition branch that checks if Input: Get Touch Count is above zero as the first thing in Update.