How to disable node hit test in scenekit?

I need to make a SCNNode click-through. Can you help?

Replies

You can use SCNHitTestOption.categoryBitMask to decide which nodes to test.

// check what nodes are clicked
let p = self.convert(theEvent.locationInWindow, from: nil)
let hitResults = self.hitTest(p, options: [.categoryBitMask: 0x01])


If (SCNNode.categoryBitMask & SCNHitTestOption.categoryBitMask) == 0, the node will be ignored.