Reputation: 31
Apple Document: Stored Entities
My another question: RealityKit – Stored Entities & Load the Scene Aynchronously from the URL
My function result return a (Entity & HasAnchoring)
My question is...How to show the AnchorEntity.(self.arView.scene.addAnchor??)
I'm new here.Thanks
Upvotes: 1
Views: 1545
Reputation: 218
After you have loaded the AnchorEntity you can add it to the scene like this:
arView.scene.addAnchor(anchor)
And that should be it. For instance if you set horizontal plane anchoring when you created the project in RealityComposer, then it should place your AnchorEntity once you detect a horizontal plane
There is a bug in iOS 13.5 to 13.6.1. It is fixed in the iOS 14 beta. A workaround is to use the .rcproject file format instead.
if let anchor = try? Entity.loadAnchor(named: "AR") {
arView.scene.addAnchor(anchor)
}
Upvotes: 2