In macOS project with RealityKit and SwiftUI, adding OrthographicCameraComponent causes crashes in both Xcode Preview and at runtime.
import SwiftUI
import RealityKit
struct ContentView: View {
var body: some View {
RealityView { content in
var camera = Entity()
var component = OrthographicCameraComponent()
component.scale = 5
camera.position = [0, 0, 5]
camera.components.set(component)
content.add(camera)
content.add(ModelEntity(mesh: .generateSphere(radius: 1)))
}
}
}
#Preview {
ContentView()
}
Has anyone faced this issue or knows a fix?