I'm using Apples SceneKit and have a custom .dae asset. I've converted the asset to a .scn file. I am grabbing the SCNNode by name from the .scn file. After placing the SCNNode in my SCNView scene as a child node and setting it's position to be SCNVector3(0,0,-1), it ignores this position and instead follows my phone location. The asset renders right on top of me and when I walk away, it follows me. It's getting to be very annoying and I can't find a solution.
However, if I replace the SCNNode taken from the .scn file, and use a SCNBox, instead, everything works just fine. The cube stays in it's set position.
Here is the relevant code:
func addCoins(at position: SCNVector3) {
let donorScene = SCNScene(named: "art.scnassets/nodes.scn")
if let coin = donorScene?.rootNode.childNode(withName: "coin", recursively: true) {
coin.position = position // 0, 0, -1 (right in front of me)
scene.scene.rootNode.addChildNode(coin)
}
}
Attached is a screenshot showing what I see whenever I move.
