Hi, I implemented it as shown in the link below, but it does not animate. https://developer.apple.com/videos/play/wwdc2023/10080/?time=1220
The following message was displayed No bind target found for played animation.
import SwiftUI
import RealityKit
struct ImmersiveView: View {
var body: some View {
RealityView { content in
if let entity = try? await ModelEntity(named: "toy_biplane_idle") {
let bounds = entity.model!.mesh.bounds.extents
entity.components.set(CollisionComponent(shapes: [.generateBox(size: bounds)]))
entity.components.set(HoverEffectComponent())
entity.components.set(InputTargetComponent())
if let toy = try? await ModelEntity(named: "toy_drummer_idle") {
let orbit = OrbitAnimation(
name:"orbit",
duration: 30,
axis:[0, 1, 0],
startTransform: toy.transform,
bindTarget: .transform,
repeatMode: .repeat)
if let animation = try? AnimationResource.generate(with: orbit) {
toy.playAnimation(animation)
}
content.add(toy)
}
content.add(entity)
}
}
}
}