How do i get the name of the streaming level that actor is present in.

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "GameFramework/Actor.h"
#include "MyBlueprintFunctionLibrary.generated.h"

/**
 * 
 */
UCLASS()
class PROJECTNAME_API UMyBlueprintFunctionLibrary : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()
	
	UFUNCTION(BlueprintPure, Category = NYTaskHelper)
	static FName GetStreamingLevelNameFromActor(AActor* Actor)
	{
		if (Actor != nullptr)
		{
			return Actor->GetLevel()->GetOuter()->GetFName();
		}

		return NAME_None;
	}
};
3 Likes