Im trying have my camera point at and follow the ship, but I don't want it to rotate when my ship rotates, how can I achieve this?
Code so far:
let targetNode = SCNLookAtConstraint(target: ship)
targetNode.gimbalLockEnabled = true
cameraNode.constraints = [targetNode]
ship.addChildNode(cameraNode)
//button click
SCNAction.rotateToX(0.0, y: 1.0, z: 0.0, duration: 0.5)
( both camera and ship rotate, but I would only like the ship to rotate. )
Instead of making the cameraNode a child of the ship, you should update its position manually at each frame based on the ship's position.
I just posted an answer with a code sample right here.