# Is there a C++ equivalent to a Level Blueprint?

**URL:** <https://forums.unrealengine.com/t/is-there-a-c-equivalent-to-a-level-blueprint/292917>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [September 4, 2014, 11:18pm UTC](https://forums.unrealengine.com/t/is-there-a-c-equivalent-to-a-level-blueprint/292917 "2014-09-04T23:18:11Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![evillego6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@evillego6](https://forums.unrealengine.com/u/evillego6)\
**Post date:** [September 4, 2014, 11:18pm UTC](https://forums.unrealengine.com/t/is-there-a-c-equivalent-to-a-level-blueprint/292917/1 "2014-09-04T23:18:11Z")

</div>

I’ve started converting my entirely blueprint game into a C++/Blueprint mix, and I’m still in the stages of wrapping my head around what equates to what between the two. Functions and events on actors make sense to me, but where does the level blueprint stuff go in C++? I’ve tried researching it but I’m not really finding anything that is giving me the answer I’m after. Perhaps I’m just searching the wrong terms or my idea of how this conversion will go is off base.

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [September 5, 2014, 1:49am UTC](https://forums.unrealengine.com/t/is-there-a-c-equivalent-to-a-level-blueprint/292917/2 "2014-09-05T01:49:46Z")

</div>

#Yes There Is

#Solus Level BP Tutorial

Here is my tutorial on this subject, lots of code included!

And pics!

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

#Summary

There is a C++ base class for level blueprints that you can extend to create your own level blueprints with their own functions and variables

you then re-parent the level BPs of any existing levels to your new level bp!

you can set a config var to automate this for all new levels

---

<div class="post-metadata">

**Author:** ![evillego6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@evillego6](https://forums.unrealengine.com/u/evillego6)\
**Post date:** [September 5, 2014, 2:20pm UTC](https://forums.unrealengine.com/t/is-there-a-c-equivalent-to-a-level-blueprint/292917/3 "2014-09-05T14:20:45Z")

</div>

Thanks , you’re awesome.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_ecb5cc49](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_ecb5cc49](https://forums.unrealengine.com/u/anonymous_user_ecb5cc49)\
**Post date:** [May 12, 2015, 12:39am UTC](https://forums.unrealengine.com/t/is-there-a-c-equivalent-to-a-level-blueprint/292917/4 "2015-05-12T00:39:26Z")

</div>

Again, an excellent response. The only thing better than this would be if C++ supported partial classes and we could do it without inheritance.

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [May 12, 2015, 2:31am UTC](https://forums.unrealengine.com/t/is-there-a-c-equivalent-to-a-level-blueprint/292917/5 "2015-05-12T02:31:04Z")

</div>

I kind of worried that Quastion and Anwser might be misleading so heres my note to it.

Indeed there is level blueprint C++ class, but there is not equivalent of level blueprint for C++… why? Because level blueprint is a special blueprint that is saved with the level, something that you can’t replace with C++. It’s designed to contain level script, the C++ class is just there to function as base for it, you can extend it if you want with events that can be called from C++ which can be useful support to communicate between AGameMode and level blueprints. As for level meta data you should use AWorldSettings instead to extend World Settings tab which is also saved with the level.

I’m saying this because there people who makes newbie mistake by treating level blueprint as a master class of the whole game code, any functions that relates the game globally, not level should be contained in AGameMode or UGameInstance (diffrence is AGameMode resets each match/level change) not level blueprint, level blueprint is exclusively for level scripting

---

<div class="post-metadata">

**Author:** ![MaxPower42](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MaxPower42](https://forums.unrealengine.com/u/MaxPower42)\
**Post date:** [November 15, 2015, 12:34pm UTC](https://forums.unrealengine.com/t/is-there-a-c-equivalent-to-a-level-blueprint/292917/6 "2015-11-15T12:34:12Z")

</div>

So what’s the best and cleanest way to add some level-specific code? I’m a total beginner and I want to make changes to the skybox on a per-tick base (or maybe using timers). It would be very easy with level blueprint I guess, but if I want to use code exclusively?

Sorry, if this has already been answered in the links. I’m learning all kinds of basics atm and don’t really want to know anything in too much depth yet 🙂

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [November 17, 2015, 3:58am UTC](https://forums.unrealengine.com/t/is-there-a-c-equivalent-to-a-level-blueprint/292917/7 "2015-11-17T03:58:57Z")

</div>

Make skybox class that rotates sky on tick, so you can reuse that in evert level you like. Level Blueprint is level scripting, that scripts the level

---

<div class="post-metadata">

**Author:** ![volkmedia](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@volkmedia](https://forums.unrealengine.com/u/volkmedia)\
**Post date:** [April 16, 2016, 3:44am UTC](https://forums.unrealengine.com/t/is-there-a-c-equivalent-to-a-level-blueprint/292917/8 "2016-04-16T03:44:05Z")

</div>

#Yes. The equivalent is already built into the engine.

It’s hidden for some reason. If you’re looking for the **C++ equivalent** tick the show all classes box. Search for level and you’ll see the **LevelScriptBlueprint** class.

**[ULevelScriptBlueprint][1]**  
87080-

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d74cba5b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d74cba5b](https://forums.unrealengine.com/u/anonymous_user_d74cba5b)\
**Post date:** [August 6, 2020, 1:01pm UTC](https://forums.unrealengine.com/t/is-there-a-c-equivalent-to-a-level-blueprint/292917/9 "2020-08-06T13:01:52Z")

</div>

Unfortunately the link above is dead. Use this one instead:

> **[Creating a C++ Level Blueprint | Orfeas Eleftheriou](https://www.orfeasel.com/creating-a-c-level-blueprint/)**
>
> In this post we're going to create a level blueprint which is based on a C++ class. (For this post, I'm using Unreal Engine 4.12.5) Creating a C++ Level Blueprint Fortunately, Epic has provided a straightforward way to create a Level Blueprint (which...

The key is to create a c++ class based off of the LevelScriptActor and then reparent your level blueprint to your new c++ class.

---

<div class="post-metadata">

**Author:** ![Mateusz\_Fryc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mateusz\_Fryc](https://forums.unrealengine.com/u/Mateusz_Fryc)\
**Post date:** [August 22, 2020, 1:23pm UTC](https://forums.unrealengine.com/t/is-there-a-c-equivalent-to-a-level-blueprint/292917/10 "2020-08-22T13:23:55Z")

</div>

You are lifesaver my friend, thank you!

---

<div class="post-metadata">

**Author:** ![AnotherZach](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AnotherZach](https://forums.unrealengine.com/u/AnotherZach)\
**Post date:** [August 22, 2020, 7:10pm UTC](https://forums.unrealengine.com/t/is-there-a-c-equivalent-to-a-level-blueprint/292917/11 "2020-08-22T19:10:17Z")

</div>

Use ALevelScriptActor to do your C++ stuff, then reparent your BP. Link is dead due to wiki changes, future users will have to start with ALevelScriptActor.

Note that GetLevelScriptActor() (from a ULevelStreamingDynamic\* pointer) will return null if the level instance did not finish streaming in, and did not call MyLevelInstance-\>SetShouldBeLoaded(true). You will also ave to cast it to your custom ALevelScriptActor ptr.

For level instances, GetLevelScriptActor() should only be called after OnLevelShown delegate has been broadcasted. (Bind your own method to it, so you can all it at the time you need to.)

For your custom level script actor, be sure denote BlueprintNativeEvent functions with the \_Implementation postfix.

---

<div class="post-metadata">

**Author:** ![AnotherZach](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AnotherZach](https://forums.unrealengine.com/u/AnotherZach)\
**Post date:** [August 22, 2020, 7:10pm UTC](https://forums.unrealengine.com/t/is-there-a-c-equivalent-to-a-level-blueprint/292917/12 "2020-08-22T19:10:26Z")

</div>

Use ALevelScriptActor to do your C++ stuff, then reparent your BP. Link is dead due to wiki changes, future users will have to start with ALevelScriptActor.

Note that GetLevelScriptActor() (from a ULevelStreamingDynamic\* pointer) will return null if the level instance did not finish streaming in, and did not call MyLevelInstance-\>SetShouldBeLoaded(true). You will also ave to cast it to your custom ALevelScriptActor ptr.

For level instances, GetLevelScriptActor() should only be called after OnLevelShown delegate has been broadcasted. (Bind your own method to it, so you can all it at the time you need to.)

For your custom level script actor, be sure denote BlueprintNativeEvent functions with the \_Implementation postfix.

---

<div class="post-metadata">

**Author:** ![phil123456](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@phil123456](https://forums.unrealengine.com/u/phil123456)\
**Post date:** [April 10, 2023, 5:49pm UTC](https://forums.unrealengine.com/t/is-there-a-c-equivalent-to-a-level-blueprint/292917/13 "2023-04-10T17:49:35Z")

</div>

sorry but this does not lead to a precise example  
more like a wiki backup or something
