Get All character BP in specific folder

Hello, I tried make an array from my chars folder with use ObjectLibrary feature.


void FMyGameEditorModule::GetCharactersInFolder(const FString& Path, TArray<FString>& Paths, TArray<FString>& Names)
{
    auto ObjectLibrary = UObjectLibrary::CreateLibrary(ACharacter::StaticClass(), false, true);
    ObjectLibrary->LoadAssetDataFromPath(TEXT("/Game/char"));

    TArray<FAssetData> AssetDatas;
    ObjectLibrary->GetAssetDataList(AssetDatas);
    UE_LOG(LogTemp, Warning, TEXT("Found assets: %d"), AssetDatas.Num());

    for (const auto& AssetData : AssetDatas)
    {
        Paths.Add(AssetData.ObjectPath.ToString());
        Names.Add(AssetData.AssetName.ToString());
    }
}


const FString& Path = "/Game/chars";
TArray<FString> Paths;
TArray<FString> Names;

This code returns 0 every time. I created a character class with cpp in my folder and also created Character BP but nothing return. Could someone give any idea?

Try passing true as the second argument to CreateLibrary if you want it to load Blueprints.

Also, note that object library is kind of outdated, you should be using the new asset manager stuff for this kind of thing.

I changed second argument as true. But it still gives me 0 .

Edit: When I changed ACharacter::StaticClass() as UBlueprint::StaticClass() I got result like 7(My total BP. But I should get only Character BPs)