- Home /
Question by
JeppeNygaard · Jun 14, 2011 at 08:07 PM ·
iosinputbuffertouchestouchcount
iOS touches buffer
Hi there,
I'm having a slight problem with iOS touch functionality
When my game starts the user can click anywhere on the screen to launch the game. I use this simple code:
if (Input.touchCount > 0) {
vars.gameStarted = true;
}
My problem is that if the user tabs the screen a few time it's like the touch function "remembers" the touches and uses these unused touches in the game after it is launched. It feels like it stores the "touches" in a buffer and uses these at the first possible convenience.
Does any of you know if it would be possible to re-write the above script more like this:
if (Input.touchCount > 0) {
vars.gameStarted = true;
//EMPTY TOUCH BUFFER//
}
I couldn't find anything about this in the docs so any help will be much appreciated!
Thanks Jeppe
Comment