How to use delegates as parameter

Well, &AGeneratedWorld::LoadMeshData just created a function pointer. You need a delegate there. So you want something similar to



void AGeneratedWorld::RequestWorldGeneration()
{
        WorldStats* stats = new WorldStats();
        FWorldGenerationCallback Callback = FWorldGenerationCallback::CreateRaw(this, &AGeneratedWorld::LoadMeshData);
        WorldGeneration* worldGeneration = new WorldGeneration(stats, Callback);
}


This is the closest to the metal way but you really should define LoadMeshData() as a UFUNCTION(). Then you could use FWorldGenerationCallback::CreateUObject or FWorldGenerationCallback::CreateUFunction to create the delegate. You can find more about delegates here: