I am making a game with fast 3.0 on Xcode 8.0 beta. In my GameScene, I have this touchBegan function:
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { for t in touches { let location = t.location(in: self) let nodeAtTouch = self.atPoint(location) let touchedSprite = nodeAtTouch as! SKSpriteNode print("Touch Detected") if touchedSprite is SKButton { print("Button Touched") touchedSprite.run(SKAction.resize(byWidth: 25, height: 25, duration: 0.25)) } } }
For some strange reason, the print on line 6 does not print when I touch the screen, so this means that no touch was detected. Any ideas or corrections, does anyone else have this problem? Thanks in advance.
source share