Hello, Right now I am learning some RealityKit for VisionOS. I do not receive any errors in my code so it seems okay. But I can't drag my object around. Does the SIM supports gestures in general?
//
// ImmersiveView.swift
// NewDimensionn
//
// Created by Patrick Schnitzer on 18.07.23.
//
import SwiftUI
import RealityKit
import RealityKitContent
struct ImmersiveView: View {
var earth: Entity = Entity()
var moon: Entity = Entity()
var body: some View {
RealityView { content in
async let earth = ModelEntity(named: "EarthScene", in: realityKitContentBundle)
async let moon = ModelEntity(named: "MoonScene", in: realityKitContentBundle)
if let earth = try? await earth, let moon = try? await moon {
content.add(earth)
content.add(moon)
}
} .gesture(DragGesture()
.targetedToEntity(earth)
.onChanged{ value in
earth.position = value.convert(value.location3D, from: .local, to: earth.parent!)
}
)
}
}
#Preview {
ImmersiveView()
.previewLayout(.sizeThatFits)
}```