Hello. I trained an ObjectTracker.referenceobject using ML, and am using it in RCP. After adding Anchoring to the entity, I set the Target mode to Object and applied the trained model data ObjectTracker.referenceobject. However, there is no tracking effect after building for VisionPro. Are any permissions required? What should I do?
Anchoring Invalid
I hope Apple can provide some help.
Hi @MaoChao
I'm unable to reproduce this. First, confirm you're running on device and in a full immersive space: the simulator doesn't support object tracking, and the AnchorEntity that Reality Composer Pro creates won't reliably anchor in a window or a volume.
Next, verify your reference object. Download the sample Exploring object tracking with ARKit, run it on your device, load your .referenceobject file with the plus button in the sidebar, and confirm it tracks as expected.
If it tracks in the sample but not in your app, please file a Feedback Assistant report with your .referenceobject file, a minimal project that reproduces the issue, a sysdiagnose captured right after reproducing, and the visionOS version and build number. Reply here with the Feedback number.
Hi @MaoChao
The sample runs on visionOS 26 with one small edit.
The only visionOS 27-only piece is the ReferenceObject configuration added in startTracking() (AppState.swift). On visionOS 26 that API isn't available, so revert startTracking() to pass the enabled reference objects straight into the provider, dropping the ReferenceObject.Configuration reload loop:
func startTracking() async -> ObjectTrackingProvider? {
let referenceObjects = referenceObjectLoader.enabledReferenceObjects
// Run a new provider every time when entering the immersive space.
let objectTracking = ObjectTrackingProvider(referenceObjects: referenceObjects)
do {
try await arkitSession.run([objectTracking])
} catch {
print("Error: \(error)")
return nil
}
self.objectTracking = objectTracking
return objectTracking
}