Hello, in my starter app I have:
GameScene zPosition = -1
SKScene
// takes up entire screen
BallHolder zPosition = 0
SKSpriteNode
(child of GameScene)
// Ball holder, at the bottom left of the screen, for all the balls.
// This way I just have to move the base to move all the balls
MyBall zPosition = 1
SKSpriteNode
(each child of BallHolder)
// multiple balls
If I click on the GameScene, it gets the touchesBegan.
If I click on the BallHolder, it gets the touchesBegan.
If I click on one of the balls, MyBall get's touchesBegan.
I would like to receive all touchesBegan through GameScene, then go through the array of all nodes, in reverse, at that location I touch.
So my question is...How do I make it so that GameScene handles all the touchesBegan? Or did I misunderstand how it should work?
GameScene zPosition = -1
SKScene
// takes up entire screen
BallHolder zPosition = 0
SKSpriteNode
(child of GameScene)
// Ball holder, at the bottom left of the screen, for all the balls.
// This way I just have to move the base to move all the balls
MyBall zPosition = 1
SKSpriteNode
(each child of BallHolder)
// multiple balls
If I click on the GameScene, it gets the touchesBegan.
If I click on the BallHolder, it gets the touchesBegan.
If I click on one of the balls, MyBall get's touchesBegan.
I would like to receive all touchesBegan through GameScene, then go through the array of all nodes, in reverse, at that location I touch.
So my question is...How do I make it so that GameScene handles all the touchesBegan? Or did I misunderstand how it should work?
Found the answer below. It turns out that I have to set everyone else's
Except the GameScene's to true
Now it works
Controlling User Interaction on Nodes
Code Block isUserInteractionEnabled = false
Except the GameScene's to true
Now it works
Controlling User Interaction on Nodes