9

I've noticed that touchesEnded don't always get delivered to an SKScene on multi touch. Depending on speed of removing fingers etc, I would permanently miss some of the touchesEnded. touchesCancelled is implemented and I added a custom UIView and put over the left side of the screen - no problems. I made a custom SKView and captured events - again no problem.

It's obvious that SKScene doesn't get all the touchesEnded the SKView it's embedded in, but why?

(BTW, I'm running the SKScene completely without any nodes)

EDIT:

Some further investigation reveals I can get SKScene to lose a touch entirely:

I put 3 fingers on the display then remove them one at a time until only one finger touches. I move the finger -> only the SKView receives the move events, the SKScene doesn't. Nor does it receive the touchesEnded.

After some experimentation I can say that it happens when a touchesBegan receives more then 1 touch in a call (e.g. you press two fingers "simultaneously"). These two touches then get entangled so only one of them sends events.

This appears to be a bug in SKScene. I'm testing on an iPhone 5. It would

Nuoji
  • 3,438
  • 2
  • 21
  • 35
  • any gesture recognizers running? multi touch enabled? received multiple touches ended in a single event? – CodeSmile Oct 30 '13 at 18:03
  • @LearnCocos2D no gesture recognizers (just running a plain SKScene as test), multi touch enabled. I'm getting multiple touches in a single touchesBegan, and I'm also listing the other touches in the event. The lost touches simply disappears from allTouches when I detect a later touchesEnded. – Nuoji Oct 31 '13 at 08:25

1 Answers1

2

May be you are using some gestureRecognisers? They have property cancelsTouchesInView and it's default value is YES. Changing it to NO solved my problem.

Florelit
  • 21
  • 3