skip to Main Content

Xcode – Did touch function not working in SpriteKit

import SpriteKit class GameScene: SKScene { var cam: SKCameraNode? var player: SKSpriteNode? override func didMove(to view: SKView) { super.didMove(to: view) cam = SKCameraNode() self.camera = cam self.addChild(cam!) player = self.childNode(withName: "player") as? SKSpriteNode } func touchesBegan(touches: NSSet, withEvent event: UIEvent)…

VIEW QUESTION
Back To Top
Search