SKScene touchesEnded not called when presenting the scene for the second time

170 Views Asked by At

I have a game with SpriteKit that have a main menu. The menu labels are triggered on touchesEnded. This works fine when starting the game for the first time.

Then, after the first level ends, the main menu is presented again. This time, touchesEnded is not triggered!!!

I tried showing another menu (the options menu) and the same thing happens. When I show it for the first time it works (I mean touchesEnded) but showing it for the second time make touchesEnded not called!!

Does anyone faced this?

1

There are 1 best solutions below

1
Tony On

What was causing the problem is that inside my game level I have a UITapGestureRecognizer. I should do the following:

myTapRecognizer.cancelsTouchesInView = false

It looks like the taprecognizer cancels the touches globally not only in the scene that it belongs to.