diff --git a/Sources/ARKit-CoreLocation/SceneLocationView.swift b/Sources/ARKit-CoreLocation/SceneLocationView.swift index 7826a0ae..8c6c6dd0 100644 --- a/Sources/ARKit-CoreLocation/SceneLocationView.swift +++ b/Sources/ARKit-CoreLocation/SceneLocationView.swift @@ -292,6 +292,18 @@ public extension SceneLocationView { self.locationNodeTouchDelegate?.annotationNodeTouched(node: touchedNode) } else if let locationNode = firstHitTest.node.parent as? LocationNode { self.locationNodeTouchDelegate?.locationNodeTouched(node: locationNode) + } else { + var node: SCNNode? = firstHitTest.node + var iteration = 0 + let maxIterations = 1000 + while node != nil, iteration < maxIterations { + if let locationNode = node as? LocationNode { + self.locationNodeTouchDelegate?.locationNodeTouched(node: locationNode) + return + } + node = node?.parent + iteration+=1 + } } }