SceneKit - different behavior when debugging

Hello,

I'm currently working on my first SceneKit game and have encountered an issue related to moving an SCNNode using a UIPanGestureRecognizer.

When I deploy the game to my iPhone via Xcode in debug mode, all interactions are smooth. However, when I stop the debugging session and run the game directly from the device (outside of Xcode), the SCNNode movement behaves inconsistently — it works sometimes smoothly and sometimes not and the interaction becomes choppy. The SCNNode movement is controlled using a UIPanGestureRecognizer.

Do you have any ideas what might be causing the issue?

Accepted Answer

I think that I found the issue. It was related to the cameraNode.camera!.zNear, which by default is set to 1.0. I changed it to cameraNode.camera!.zNear = 0.01 and it seems to work much better.

SceneKit - different behavior when debugging
 
 
Q