World Partition C++ Problem

Hey Guys,

Lately was trying to get spline Information out of the World Partition Actors at Runtime and failed, or just any partitioned object that is not loaded is hard to get to, this is what i got currently:

{
	    if (!World) return;

	FGraphEventRef Task = FFunctionGraphTask::CreateAndDispatchWhenReady([=]()
	{
		if (!World || !World->GetWorldPartition()) 
	    {
	        UE_LOG(LogTemp, Error, TEXT("World or WorldPartition is invalid!"));
	        return;
	    }

	    UWorldPartition* WorldPartition = World->GetWorldPartition();
	        if (!WorldPartition)
	        {
	            UE_LOG(LogTemp, Error, TEXT("Failed to get WorldPartition."));
	            return;
	        }

	        
	    	FWorldPartitionHelpers::FForEachActorWithLoadingParams Params;
			Params.ActorClasses.Add(ALandscape::StaticClass());
	    	Params.ActorClasses.Add(ALandscapeStreamingProxy::StaticClass());
			Params.bKeepReferences = true;
	    	

			FWorldPartitionHelpers::ForEachActorWithLoading(WorldPartition, [&](const FWorldPartitionActorDescInstance* ActorDescInstance) -> bool
			{
				
				AActor* LoadedActor = ActorDescInstance->GetActor(true, true);
				if (!LoadedActor)
				{
					UE_LOG(LogTemp, Warning, TEXT("Failed to load actor from ActorDescInstance."));
					return true; 
				}

				UE_LOG(LogTemp, Error, TEXT("Loaded Actor: %s"), *LoadedActor->GetName());

				return true; 
			}, Params);
    }, TStatId(), nullptr, ENamedThreads::GameThread);

    FTaskGraphInterface::Get().WaitUntilTaskCompletes(Task);

    UE_LOG(LogTemp, Log, TEXT("Road Network Generated from Landscape Splines."));
}

oh yea i cut down the function to check if its working anyways, :confused:

What does the log texts say?

give me a second im printing it to the screen now instead my log is handling 5million AI characters.

it is jumping straight to road network generated no other logs, its wierd

You mean “Road Network Generated from Landscape Splines.” ?

Try printing text any time you execute something. Whether it be only opening a function or assigning values and such. Trace the bug.