However, when I print the touchedNodes.count I get zero, and touchedNodes does have a raw value.
If anyone knows what I'm doing wrong here....or missing?
p.s. I tried doing this from GameScene itself, but touchesBegan was never received.
Code Block override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { guard let touch = touches.first else { return } let location = touch.location(in: self) let touchedNodes = self.nodes(at: location) print ("\(touchedNodes.count)") //combine next two lines for node in touchedNodes.reversed(){ var thisBall = node as? MyBall if thisBall!.nodeType == "ball" { self.currentNode = node } } }
Code Block isUserInteractionEnabled = false
Except the GameScene's to true
Now it works
Controlling User Interaction on Nodes