I'm attempting to replicate the "blasting mode" behavior from the demo in WWDC 2017 Session 609 - Going Beyond 2D with SpriteKit.
In this demo: a tap on the screen displays an anchored emoji and in blasting mode, a tap on the emoji removes it.
I'm not sure how to detect taps on the emoji.
I've tried a few things in touchesBegan of my SKScene subclasss like:
if let touchLocation = touches.first?.location(in: sceneView),
let hit = sceneView.hitTest(touchLocation, types: .featurePoint).first {
let anchor = ARAnchor(transform: hit.worldTransform)
let node = sceneView.node(for: anchor)
node?.removeFromParent()
}
or
if let touchLocation = touches.first?.location(in: sceneView),
let node = nodes(at: touchLocation).first {
node.removeFromParent()
}