Search code examples
swiftxcodenodesscenekitarkit

How can I make nodes orbit around the camera?


I’m using the ARKit and SceneKit, I want nodes to orbit around the user’s camera, but without moving, just when you move the camera in 360 you can look at the nodes around it, as they are staying at the same position around the camera. Also, if you’re moving in the real world I want the nodes to follow the camera.

I’ve managed to do both of the things separately but not together at the same time.

How can I make it happen?

Thank you.


Solution

  • One solution would consist in using a SCNReplicatorConstraint with replicatesOrientation = NO so that the nodes move with the camera but don't rotate with it.