I want to change the opacity of a 3D object with animation. Since RealityKit is highly integrated with SwiftUI on visionOS, I tried this method:
withAnimation(.easeInOut) {
model.components[OpacityComponent.self] = .init(opacity: 0.25)
}
However, it didn’t work.