Blueprint Callable Function not iterating properly

I’m working on a procedural level script. I can’t call CreaeInstance() in code so i have to split my code into two blocks. One for selecting the level from an array that is populated inside of blueprint and another function that sets the level properties such as bShouldBeLoaded, bShouldBeVisible, and the level transform.

So far I have to code working in the sense that it spawns a level without crashing but the problem here is that it goes right to the end of the For Loop and only spawns the last iteration. I will post my code and Blueprints I’m hoping someone will be able to tell me how to “pause” the for loop so it does each iteration properly.

CPP:

void AProceduralLevelScript::GenerateLevel(ULevelStreaming* &LevelToStream, FString& InstanceName, int32& x, int32& y)
{
	for(int32 x = 0; x <= GridSizeX; ++x)
	{
		for(int32 y = 0; y <= GridSizeY; ++y)
		{
			int32 randInt = FMath::RandRange(0, LevelNames.Num() - 1);
			LevelToStream = UGameplayStatics::GetStreamingLevel(GetWorld(), LevelNames[randInt]);
			InstanceName = FString::FromInt(x) + FString::FromInt(y);
		}
	}


}

void AProceduralLevelScript::SetLevelProperties(ULevelStreaming* level, int32 x, int32 y)
{
	level->bShouldBeLoaded = true;
	level->bShouldBeVisible = true;
	level->LevelTransform = FTransform(FVector((GridSizeX * LevelSizeX / 2) - LevelSizeX * x, (GridSizeY * LevelSizeY / 2) - LevelSizeY * y, 0.0f));
}

After trying everything I could think of to get the for loops to iterate properly I just took the for loops out of the code and used two for loop nodes in blueprint. It works perfectly and I assume that the issue is the difference in speed. I assume that the code iterates faster than Blueprint can register so it would only get the very last iteration of the for loops.