Post not yet marked as solved
Click to stop watching this thread.
You have stopped watching this post. Click to start watching again.
Post marked as unsolved with 2 replies, 0 views
I am just documenting my discoveries in case it is of use to anyone else but I managed to perform a raycast from the node so that it detects things other than its child nodes, I run this function on update but I am not sure if there is a more efficient way of doing it.
func heightTest(){
let result = sceneNode?.hitTestWithSegment(from: sceneNode!.position, to: SCNVector3(x: sceneNode!.position.x, y: -100, z: sceneNode!.position.z), options: [SCNHitTestOption.rootNode.rawValue: scene.rootNode])
if let intersection = result?.first?.simdWorldCoordinates {
print(intersection)
}
}