I know this is late, but just in case there are other people looking for a solution.
Try turning on the Spatial Mapping Mode like the image below.
If you’re doing this in C++, try this code
#include "ARBlueprintLibrary.h"
#include "MRMeshComponent.h"
void AARTrackableMonitor::BeginPlay()
{
Super::BeginPlay();
// Subscribe to Tracked Geometry delegates
UARBlueprintLibrary::AddOnTrackableAddedDelegate_Handle(
FOnTrackableAddedDelegate::CreateUObject(this, &AARTrackableMonitor::OnTrackableAdded)
);
}
void AARTrackableMonitor::OnTrackableAdded(UARTrackedGeometry* Added)
{
// When tracked geometry is received, check that its from spatial mapping
if(Added->GetObjectClassification() == EARObjectClassification::World)
{
UMRMeshComponent* MRMesh = Added->GetUnderlyingMesh();
}
}
For more info, go to Spatial Mapping in Unreal - Mixed Reality | Microsoft Learn