I have an SCNNode that has a camera named pointOfViewNode
whenever I push a button i call the function update camera in which I want the SCNNode to change its position to a focused target, however when I call this function the position does not change as desired, how can I make it to where I can?
func updateCamera()
{
targetNode = SCNLookAtConstraint(target: planetNodeArray[currentFocusedElement])
pointOfViewNode.constraints = [targetNode]
//positions the camera node
pointOfViewNode.position = SCNVector3(x: planetNodeArray[currentFocusedElement].position.x - 3 , y:planetNodeArray[currentFocusedElement].position.y + 65, z: planetNodeArray[currentFocusedElement].position.z + 2)
pointOfViewNode.rotation = SCNVector4Make(1, 1, 1, -90)
self.rootNode.addChildNode(pointOfViewNode)
print(pointOfViewNode.position)
}