- Home /
Not getting a response when a touch doesn't move with TKtouchkit
Hey guys,
I'm using the TKTouchKit at the moment by prime31, which is great. I made my own recognizer that handles long touches as it aids in moving a character in a scroller environment by means of translating the touch position into world position and the camera follows the character accordingly. One thing that is driving me nuts, is this incredibly noticeable loss of touch position unless my finger is constantly moving. I translate the touch coordinates into world coordinates for every touch phase and while it is usually super smooth, whenever I keep my finger in one place on my iPhone 5S and 4, the character stops at the world position given by the touch position when the finger stopped moving even after the camera scrolls, which in turn should give a new coordinate. This is cured when I just slightly move my finger, but it is quite annoying when it happens because the character should continuously follow the touch position as the camera scrolls. On my mac, this is not the case, so it seems as though the mouse cursor events are handled differently.
Is there a way around this? It seems as though touchesMoved is taken quite literally, but not on the mac!! Is there a way to include something like touchesStagnent?? I'm sure this is a simple work around, but I'm not the most experienced programmer..
Thanks in advance,
Answer by highpockets · Feb 02, 2014 at 09:43 PM
I solved this. I had ScreenToWorldPoint in the recognizer and since it was not recognizing the touch while my finger was still, the event never fired and therefore the position didn't change until I moved my finger. I have now taken ScreenToWorldPoint out of the recognizer and placed it inside my movement script and it works as expected.