# How to store level as variable?,How to save current level as variable?

**URL:** <https://forums.unrealengine.com/t/how-to-store-level-as-variable-how-to-save-current-level-as-variable/447735>\
**Category:** Blueprint\
**Tags:** unreal-engine, UE4, Blueprint, CPP, question\
**Created:** [April 23, 2019, 10:21pm UTC](https://forums.unrealengine.com/t/how-to-store-level-as-variable-how-to-save-current-level-as-variable/447735 "2019-04-23T22:21:38Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_1418e767](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_1418e767](https://forums.unrealengine.com/u/anonymous_user_1418e767)\
**Post date:** [April 23, 2019, 10:21pm UTC](https://forums.unrealengine.com/t/how-to-store-level-as-variable-how-to-save-current-level-as-variable/447735/1 "2019-04-23T22:21:38Z")

</div>

In my project I would like the current level the player is on to be stored as a variable so that it is easy to restart the level they are on when the character dies. Answers in both blueprints and c++ would be helpful.,I don’t know if this is right but in my project I would like the current level the players is on to be stored as a variable so it is easy to make the restart code. Both c++ and blueprints would be fine. I am using unreal engine 4.22.

---

<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:** [April 23, 2019, 10:32pm UTC](https://forums.unrealengine.com/t/how-to-store-level-as-variable-how-to-save-current-level-as-variable/447735/2 "2019-04-23T22:32:06Z")

</div>

Every asset has it class and level is ULevel. Usally you can figure name of the class by looking on asset type name in tooltip inside parenthesis

But level is usually stored as FName as UE4 use URI address to open levels and connect to server

---

<div class="post-metadata">

**Author:** ![Nebula\_Games\_Inc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nebula\_Games\_Inc](https://forums.unrealengine.com/u/Nebula_Games_Inc)\
**Post date:** [April 23, 2019, 11:02pm UTC](https://forums.unrealengine.com/t/how-to-store-level-as-variable-how-to-save-current-level-as-variable/447735/3 "2019-04-23T23:02:52Z")

</div>

You can store your levels as an integer variable in an “actor object” you place in each level. If you name each level (map) something like “LevelX” where “X” is a number then you can simply create an array of your level names, and use a get node with an integer for the level to select and open whatever level the player is on based on the integer variable saved to a save game object. Similar to this setup.

 ![275031-level-save-system.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/0/3/303702d46375e0ffad9713208c781b19e6540087.jpeg)

---

<div class="post-metadata">

**Author:** ![mightyenigma](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mightyenigma](https://forums.unrealengine.com/u/mightyenigma)\
**Post date:** [April 24, 2019, 2:29pm UTC](https://forums.unrealengine.com/t/how-to-store-level-as-variable-how-to-save-current-level-as-variable/447735/4 "2019-04-24T14:29:06Z")

</div>

Blueprints:  
There is a node named GetCurrentLevelName or something like that. It returns a Name you can store either as a Name or a String. You can use this same Name or String as the input for the Open Level node.

There might be a RestartLevel node on some kinds of GameMode too, which might be simpler, but I dont remember.

---

<div class="post-metadata">

**Author:** ![OeilDeLance43](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@OeilDeLance43](https://forums.unrealengine.com/u/OeilDeLance43)\
**Post date:** [September 30, 2024, 8:12pm UTC](https://forums.unrealengine.com/t/how-to-store-level-as-variable-how-to-save-current-level-as-variable/447735/5 "2024-09-30T20:12:33Z")

</div>

C++ use:  
` TSoftObjectPtr<UWorld>`

Blueprint: SoftWorldReference

---

<div class="post-metadata">

**Author:** ![Csd12349](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/csd12349/32/88710_2.png) [@Csd12349](https://forums.unrealengine.com/u/Csd12349)\
**Post date:** [October 26, 2024, 9:43am UTC](https://forums.unrealengine.com/t/how-to-store-level-as-variable-how-to-save-current-level-as-variable/447735/6 "2024-10-26T09:43:30Z")

</div>

Life saver man

---

<div class="post-metadata">

**Author:** ![Absolute\_Lad](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Absolute\_Lad](https://forums.unrealengine.com/u/Absolute_Lad)\
**Post date:** [February 13, 2025, 9:52pm UTC](https://forums.unrealengine.com/t/how-to-store-level-as-variable-how-to-save-current-level-as-variable/447735/7 "2025-02-13T21:52:57Z")

</div>

I know I’m a bit late but I solved this by getting a node with the level in it (I used the open level by object reference node), right clicked the level input and promoted it to variable. Feel free to delete the open level node after. Worked perfect for me

---

<div class="post-metadata">

**Author:** ![RandomForum](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RandomForum](https://forums.unrealengine.com/u/RandomForum)\
**Post date:** [January 4, 2026, 6:02am UTC](https://forums.unrealengine.com/t/how-to-store-level-as-variable-how-to-save-current-level-as-variable/447735/8 "2026-01-04T06:02:26Z")

</div>

Also very late to the party. This worked wonderfully. It’s lame that the world variable doesn’t show up as an option

---

<div class="post-metadata">

**Author:** ![ibrahimaysan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ibrahimaysan](https://forums.unrealengine.com/u/ibrahimaysan)\
**Post date:** [March 10, 2026, 7:58pm UTC](https://forums.unrealengine.com/t/how-to-store-level-as-variable-how-to-save-current-level-as-variable/447735/9 "2026-03-10T19:58:26Z")

</div>

You can just seach “Soft World Reference” it shows as struct but it has member inside struct that actually lets you choose level. Just confusing naming made me thought there is no variable but only namings for Levels for a while until i’ve found this.
