- Home /
Determining new touches (logic problem)
I'm having some trouble figuring out the best way to determine which of the total touches on a touchscreen is new. I've done a little answer searching and thinking but haven't been able to come up with anything. So any help or a link would be appreciated.
So far my logic is to check whether the touch count has increased since the last frame, and if it has, figure out which is the new touch and do some things with it. Problem is, I don't know how to determine which touch is the new one. I'm aware of fingerId but not how I can use that to determine if it's new.
I guess this is kind of a logic question more than anything. It's like you have a box of items, you know the number of items increased, but how do you determine which was the new item put in the box?
Answer by Fattie · Oct 14, 2012 at 05:46 AM
fortunately it\s very simple (compared to doing input on other platforms), Unity does all the hard work for you. In fact Unity tracks the "which finger" logic"
here is a massive answer absolutely and totally explaining what you need !
it includes a full demo that will show you how it works on Unity
http://answers.unity3d.com/questions/326253/strange-touch-behavior.html#answer-326285
please be sure to VOTE UP such useful long answers!
Ah, thanks Fattie.
It's TouchPhase.Began I was looking for. Helpful link, I've upvoted it. Hopefully it can be more pro$$anonymous$$ent in search results.
THAN$$anonymous$$ YOU for the up vote !!! :)
you're absolutely right - other than kidding around, the plethora of votes make it pro$$anonymous$$ent for new friends searching for the info. Well said.
cheers again