I have a (simple) question: how do you get the current level name in blueprints?
Thanks for responding!
I have a (simple) question: how do you get the current level name in blueprints?
Thanks for responding!
You mean the file name? the package name like MyLevel.umap ?
I can create that BP node if there is no way to do that presently
Rama
Thats exactly what i need. If you could do that, that would be great!
If there isn’t a “Get Level Name” node of some type, I suppose one way you could get it would be to store it’s name in a variable as you load it?
I use Name variables to store my level names for loading, so for instance I could have “Current Level Name” variable set using the level variable on load.
But how do you do that then? am i right that i then should initialize the level name in the level blueprint? and how do i get it then?
Basically, i have a blueprint with a triggerbox. when i enter the triggerbox, the level is completed and i should get the level name, add 1 to it, and so load the next level.
Make a Purple Name variable called say “Current Level”. When you “Open Level” or “Load Stream Level” you Set your “Current Level” variable using whatever name used to open/create a level.
Anytime you want to know the current level you just Get “Current Level” variable.
When you “Open Level” it wants a name that is basically the name of the Level file minus the .umap.
Any way to do this without first running an “Open Level” command?
I’m trying to create a UMG Widget menu that has a “next” button that simply loads the next sequential map name. IE I name my levels Game01.umap Game02.umap etc.
I have answered this in another question, but it will require you to create a custom C++ blueprint node, please check:
https://answers.unrealengine.com/questions/122415/how-to-get-map-name-in-bp.html#answer-148974
In Blueprints, it is a standard function (not sure how long this has been the case)
You need to remove the path though to do that.
Not sure when it was added, but in the blueprint node Get Current Level Name, they added “Remove Prefix String” which is on be default, click on the triangle to see the option. It removes the path and such before returning the level name.
Cheers,