How to get nodes of scene (SceneKit) by tap gesture in SwiftUI SceneView?

95 Views Asked by At

I am trying to use SceneKit in SwiftUI. SceneView makes many things easy without the need of the UIViewRepresentable but I cannot reach to the location information when I tap on the scene in the SceneView.

Is there a way to get the nodes in a scene with the tap gesture in a SceneView?

            import SwiftUI
            .........
            .........
            SceneView(
                // 1
                scene: modelSceneKit.scene,
                // 2
                pointOfView: moveCamera(),
                // 3
                options: nil
            )
            .gesture(
                   .onEnded(){ event in
                         // get nodes in a scene
                   }
            )
            .........
            .........
0

There are 0 best solutions below