Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func loadEntitySync() {
- // Create an world anchor at the origin and add it to the scene
- let anchor = AnchorEntity(world: [0,0,0])
- arView.scene.addAnchor(anchor)
- // Handle errors in case the file doesn't exist
- do {
- let usdzPath = "path/to/usdz/asset"
- let modelEntity = try ModelEntity.loadModel(named: usdzPath)
- anchor.addChild(modelEntity)
- } catch {
- print("file not found")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement