# Loading the Next Level (UE 4.27)

**URL:** <https://forums.unrealengine.com/t/loading-the-next-level-ue-4-27/495452>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [February 7, 2022, 8:46pm UTC](https://forums.unrealengine.com/t/loading-the-next-level-ue-4-27/495452 "2022-02-07T20:46:51Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![pezzott1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pezzott1/32/1215068_2.png) [@pezzott1](https://forums.unrealengine.com/u/pezzott1)\
**Post date:** [February 8, 2022, 5:54am UTC](https://forums.unrealengine.com/t/loading-the-next-level-ue-4-27/495452/7 "2022-02-08T05:54:17Z")

</div>

This is the struct (just an example):

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/3/1/e311b530ddceebe4a5e2b254b60fec103ba8e8bb.png)

In Game Instance I created an array and populated the struct for each level:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/3/5/a35cf1971bb6b0fb75b926a19f2924ead0d8ded7.png)

I’m assuming you have a blueprint in every level that calls the Event PowerOn. If that blueprint had a public integer, you could do this:

- First get a reference to the Game Instance:  

- I’m using an interface to “complete” each level. You can use that reference to update the struct corresponding to that level, in this case calling CE\_CompleteLevel passing the LevelNumber integer.  

- This is that event in Game Instance:  

- First check if the level has been completed, if not then update and continue to next level.

- Next update the bool in the struct.

- The branch checks if all levels have been completed by comparing the int with the array length-1, if not ++LevelToLoad.

- Finally call to load next level:  

Simple enough so far…

So we basically turned this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/e/9/4e99ceef5307f0791f3f568098a2fafe042d080b.png)

Into this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/2/e/92e6919ce5ff96c66c47d4034eefcffa6e9a3010.png)  
With the added bonus that if I add 100 more levels, all I have to do is update the array of structs.

[https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/5/a/35ae47befc8978527af63ee805de7938c369b113.mp4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/5/a/35ae47befc8978527af63ee805de7938c369b113.mp4)

Hope it helps.  
Also, forget the idea I typed in prev post… it’s overly complicated for the same result.

---

_[View the full topic](https://forums.unrealengine.com/t/loading-the-next-level-ue-4-27/495452)._
