Animation cannot be played in AR scene

Xcode:13.1

iOS:15.1

USDZ:https://sketchfab.com/3d-models/spartan-armour-mkv-halo-reach-57070b2fd9ff472c8988e76d8c5cbe66

The animation can be played in iOS14, but after I update to iOS15, the animation cannot be played.

Thanks

import UIKit
import ARKit
import RealityKit
import Combine


class ViewController: UIViewController {
   
  @IBOutlet var arView: ARView!
   
  var rootAnchor: AnchorEntity!
   
   
  override func viewDidLoad() {
    super.viewDidLoad()
     
    rootAnchor = AnchorEntity(plane: .horizontal)
    arView.scene.addAnchor(rootAnchor)
     
    var cancellable: AnyCancellable? = nil
    cancellable = Entity.loadAsync(contentsOf: Bundle.main.url(forResource: "Spartan_Armour_MKV_-_Halo_Reach", withExtension: "usdz")!)
      .sink(receiveCompletion: { error in
        DispatchQueue.main.async {
         cancellable?.cancel()
         cancellable = nil
        }
      }, receiveValue: { [weak self] ey in
        guard let self = self else { return }

        self.rootAnchor.addChild(ey)
        ey.availableAnimations.forEach {
          ey.playAnimation($0.repeat())
        }

        DispatchQueue.main.async {
          cancellable?.cancel()
          cancellable = nil
        }
    })
  }
}

Hi, this is a bug. We are investigating it, but I don’t have a workaround for it unfortunately.

Like you, I still waiting for Apple to fix the problem

https://developer.apple.com/forums/thread/698908 https://stackoverflow.com/questions/70725165/xcode-13-usdz-available-animation-didnt-work

if you need to update downgrade the Xcode 12 and then upload a new release for temporary

Animation cannot be played in AR scene
 
 
Q