Ok so I noticed when testing my game, sometimes it never seems to get the “MouseUp” or “Ended” phase.
So I put in this code in my update loop to see exactly what was happening:
foreach (iPhoneTouch touch in iPhoneInput.touches) {
Debug.Log("iphone touch: " + touch.phase.ToString());
}
So what I found was that sometimes there is never an actual “Ended” or “Cancelled” event that happens, instead it floods with “Stationary” events even though I am not touching the screen anymore, implying that it still thinks I am touching the screen.
Anyone else run into this or know what to do about this?
Yeah, I have. Sometimes in Vertigo, when you’re lowering the brick onto the top of the stack, the game doesn’t detect that you’ve lifted your fingers off the screen, which means that you don’t drop the brick - it just floats there as though you still have your fingers in place.
Never did find a way around it - luckily if the player touches the screen again, the brick drops, as the touch screen registers the change, but I wasn’t particularly happy about it due to the fact that it breaks the design of my mechanics a little…
Yup that is exactly what happens to me. I have noticed that it seems to happen way more often on my iPhone 3G than it does on my 1st Gen Touch and never on my 3GS. I wonder if its possible that the hardware is slightly broken on some devices?
Would love if anyone authoritative on the subject could chime in?
I don’t know if it’s broken hardware so much as slow hardware. In my experience I’ve found that the more you tax the device the more likely it is to drop a touch end phase.
Well how can you create an accurate input system if the device still thinks you have a finger on the screen when you don’t? To imply this is by design doesn’t add up.
bump, anyone? If there is some kind of work around I am not thinking of? Having the user click again on the screen feels broken.
Is this only in the Editor using Unity Remote, or on the device? I have seen lots of lost touch-ended events in the Remote, but can’t recall seeing the same thing on the device.
It’s happening on the device. If it was just unity remote I would ignore it. I have found some other posts by others talking about this, but no one seems to have gotten anywhere with it.
Update:
I was able to seemingly fix most (if not all) of the issue by tweaking these settings in the AppController.mm in the XCode project:
#define kFPS 240.0
#define kAccelerometerFrequency 0.0
I may have gone overboard on the 240, but I wanted to be sure it was taking priority. I have messed with these before for frame rate increase, but never realized how much they might help on input issues on some slower devices.
Rob@Stinkbot: I own the Enhancement Pack, and read that you can automate these changes. Can you say how?
You’re barkin’ up the wrong tree there 
I got the same problem…
and i fixed to kAccelerometerFrequecy = 0.0
and every problems is solved.
thanks.
same problem is discussed here: http://forum.unity3d.com/viewtopic.php?t=34496
… but if your game need the Accelerometer too you can not put kAccelerometerFrequecy at 0.0 … hmm i hope the unity guys can fix it 