Adding SCNLookAtConstraint to node in ARKit makes it invisible

When I add an SCNLookAtConstraint in ARKit to a node that moves about (when it contains a directional light or a it of geometry) the node becomes invisible. You cannot see the geometry and you cannot see the light coming from it. Exactly the same code in a regualr scenekit simulaiton works fine.


directionalLight = SCNLight()

directionalLight?.type = .directional

lightNode?.light = directionalLight

directionalLight?.castsShadow = true

directionalLight?.shadowColor = UIColor.black

directionalLight?.intensity = defaultLightIntensity

directionalLight?.shadowRadius = 1.2

directionalLight?.zFar = 500

directionalLight?.zNear = 0

directionalLight?.orthographicScale = 10

directionalLight?.shadowSampleCount = 1

directionalLight?.temperature = 5500

directionalLight?.shadowMode = .forward

let constraint = SCNLookAtConstraint(target: virtualObject)

lightNode?.constraints = [constraint]


if I comment out the constraint the light works (but is pointing at the same direction all the time) and I can see the geometry I have added but add the constraint and it's invisible and there's no light.


Is this a bug, do I ahve to work out my own rotations?