UE4: Get Actor Streaming (Sub) Level Name

UE4: Get Actor Streaming (Sub) Level Name

I’ve been using Unreal Engine for quite a while now, and I often encounter questions related to the same topics, even small ones. In my first post about UE4 I want to answer a very simple question: how can I get the Streaming Level name of an actor?

In Blueprint we have the “Get Current Level Name”, but that returns the Persistent Level Name, not the Streaming level name:

We are going to expose a new Blueprint function, and to do so we are going to create our custom Blueprint Library in C++.

If you are coming from a Blueprint-only project, you will first need to convert it to a C++ project. To do so, you will first need to install Visual Studio, just follow the official instructions here. Then, you can go ahead and create a C++ file from the ADD NEW menu:

Now, create MyFunctionLibrary.h:

And MyFunctionLibrary.cpp:

Save and compile. This will expose a new node in your Blueprints. Just input the actor you’re looking to find the Streaming Level name for:

Hope this helps.

Credits to Elathan for first exposing the solution.

1 Comment

  1. Ivan

    Unfortunately this does not work for World Composition. Is there a way to get the sublevel name for World Composition?

Leave a Reply