Getting Instances overlapping Sphere function not working?

it may be instance data can not update at 1st frame when UHierarchicalInstancedStaticMeshComponent is created, I print log in actor “beginPlay” and actor "tick "

// Called when the game starts or when spawned
void AMyActor::BeginPlay()
{
	Super::BeginPlay();

	UWorld* const World = GetWorld(); // Get world
	if (!World) return;

	// Just prep
	FVector spawnLocation = FVector(0.f, 0.f, 0.f);
	FRotator rotator = FRotator(0.f, 0.f, 0.f);
	FActorSpawnParameters spawnParams;
	FTransform InstanceTransform;
	InstanceTransform.SetLocation(FVector::ZeroVector);
	InstanceTransform.SetRotation(FQuat::Identity);
	InstanceTransform.SetScale3D(FVector(1., 1., 1.));
	host = World->SpawnActor<AActor>(spawnLocation, rotator, spawnParams);
	host->SetActorEnableCollision(true);

	// Create HISM component
	MyTestCpt = NewObject<UHierarchicalInstancedStaticMeshComponent>(host);
	MyTestCpt->RegisterComponent();
	MyTestCpt->SetStaticMesh(MyStaticMesh);
	host->AddInstanceComponent(MyTestCpt);

	// Add three instances, near the origin.
	InstanceTransform.SetLocation(FVector(0., 0., 0.));
	MyTestCpt->AddInstance(InstanceTransform);
	InstanceTransform.SetLocation(FVector(10., 10., 10.));
	MyTestCpt->AddInstance(InstanceTransform);
	InstanceTransform.SetLocation(FVector(-10., -10., -10.));
	MyTestCpt->AddInstance(InstanceTransform);

	// Now we try and find them
	TArray<int32> ids = MyTestCpt->GetInstancesOverlappingSphere(FVector(0., 0., 0.), 100., true);

	UE_LOG(LogTemp, Warning, TEXT("Begin play ---Found %i HISMS"), ids.Num());

}

// Called every frame
void AMyActor::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

	if (MyTestCpt != nullptr)
	{
		// Now we try and find them
		TArray<int32> ids = MyTestCpt->GetInstancesOverlappingSphere(FVector(0., 0., 0.), 100., true);

		UE_LOG(LogTemp, Warning, TEXT("Tick Found %i HISMS"), ids.Num());
	}

}

293425-123545.png

you can call UHierarchicalInstancedStaticMeshComponent API -----BuildTreeIfOutdated,refrersh data at once
MyTestCpt->BuildTreeIfOutdated(false, true);

293426-11111111.png