IOS 9, Xcode 7, Multitouch with SpriteKit
Hi, I made an iOS game called "Racing Horses" and published it on the App Store. It was fine with the game on iOS 8.xx, but after I installed iOS 9 Beta 3, in the same game (same codes), the iPhone cannot recognize multiple touches. I have to leave my finger to make the next touch. But that was not the case, I could make a new click even if I was still holding my previous tap. What is the problem, what should I do?
+3
source to share
3 answers
I had the same problem in a game launched this summer.
I had to explicitly include multi-touch in SKScene
:
-(void)didMoveToView:(SKView *)view {
self.view.multipleTouchEnabled = YES;
}
More details here - The game uses subclasses SKSpriteNode
. They check the number of touches depending on the sprite. In a subclass:
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
NSLog(@"TapCount = %lu", (unsigned long)touches.count);
if (touches.count == 2) {
// do something
}
}
+8
source to share