I have a arobject files that's already tested and working perfectly in Reality Composer as an anchor. But for whatever reason when I try them both as AR Resource group in my asset or even loading it directly from the url it always fails (returns nil) I've double check all the file/group names and they seems fine and I couldn't find the error, just always nil. This is my code :
var referenceObject: ARReferenceObject?
if let referenceObjects = ARReferenceObject.referenceObjects(inGroupNamed: "TestAR", bundle: Bundle.main) {
referenceObject = referenceObjects[referenceObjects.startIndex]
}
if let referenceObject = referenceObject{
delegate.didFinishScan(referenceObject, false)
}else {
do {
if let url = Bundle.main.url(forResource: "Dragonball1", withExtension: "arobject") {
referenceObject = try ARReferenceObject(archiveURL: url)
}
} catch let myError{
let error = myError as NSError
print("try \(error.code)")
}
}
Any idea? Thanks