Here is the properties of model that appears fine.
And here is the properties of model that has problems and appears bigger and above the camera view:
Here is my code to insert the model:
func updateUIView(_ uiView: ARView, context: Context) {
// My Custom Class
guard let model = modelConfirmedForPlacement else { return }
if let modelEntity = model.modelEntity {
print("Adding model to scene: \(model.modelName)")
let anchorEntity = AnchorEntity(plane: .any)
let readyModelEntity = modelEntity.clone(recursive: true)
//Add Gestures Support for Model
readyModelEntity.generateCollisionShapes(recursive: true)
anchorEntity.addChild(readyModelEntity)
uiView.scene.addAnchor(anchorEntity)
// Install Gestures
uiView.installGestures([.all], for: readyModelEntity)
} else {
print("Unable to load modelEntity for: \(model.modelName)")
}
DispatchQueue.main.async {
modelConfirmedForPlacement = nil
}
}