I am trying to load a .dae file with the help of the following line of code:
let scene = SCNScene(named: "art.scnassets/bench.dae")
But, when I run my project, the app is crashing because the variable scene is nil.
What am I doing wrong?
I am trying to load a .dae file with the help of the following line of code:
let scene = SCNScene(named: "art.scnassets/bench.dae")
But, when I run my project, the app is crashing because the variable scene is nil.
What am I doing wrong?
Add art.scnassets to Copy Bundle Resources
I know this is pretty old, but in case anyone faces this issue like i had yesterday, here is what I did to fix the issue. I thought issue was in format, so I tried .scn model but with copying it in main directory and it worked, then guessed issue was in directory, so I copied my .dae file to main directory of project then re-added it under copy-bundle-resources from build phases and it worked perfectly. Hope this helps.
It seems that the problem was with the .dae file's size/orientation. I rotated it by 90 degrees and scaled the image down and it seems to work now.