reference to level currently loaded

hi

is there a way to get a reference to the level currently loaded in a blueprint

thanks

You can use a get all actor of class node and the class is Level Script Actor.

1 Like

how do you manipulate that
i am struggling to save the result (of all actors of class levelscriptactor) to a local variable or variable to use

Sorry Get Actor of Class is the node not Get All~. Should be able to save the return as an actor variable.

same thing
the one only wants you to dereference the array
both ways do not allow you to store as variable

This is what it looks like for me. Don’t try to use “promote to variable”, create an actor variable and use that.

what variable type did you use to create the variable to save / store to
i cant create a variable type levelscriptactor

actor object seems to work

There isn’t a levelscriptactor type that’s why you can’t use promote to variable. Actor object is fine.

1 Like

there is a “get current level” think it’s off the game mode node

1 Like

how can i manipulate the levelscriptactor now saved as a normal actor object?
i tried to cast it to a certain level to determine its type but i see cast to a level is not possible

i see there is a get level node with level object reference as output
but not sure what i can do with that
i dont see any nodes really that accept level object references

yes get level
but how do you use it
i gives a level object reference
but not sure what to do with that

What to do with it is up to you, I use it for my saved game functionality, so the game will load the level the player was in last, it’s saved there as a variable, and I have a load level function for loading from a saved game that calls “open level from object reference”

ok
you mean you plug it into a load level node?

i am trying to test if a certain level is loaded so that i can load it if not loaded
how will i do such a object or name test on a level object reference
do you know?

Load level just loads it into memory I believe, open level actually puts the player into it. I think what you’d want to do is pull of the level object reference pin and type ==

sorry i was referring to open level not load level

when i am testing whether the get level result is equal to the level of interest, i can no longer save the blueprint
it gives the error that the blueprint is now part of that level


maybe i should simply use and stick to streaming levels to avoid this mess

Streaming levels is definitely the way to go. This may help though…

thanks

how do you get “get loaded level” where the target is level instance interface
the only get loaded level i see is with target streaming level

this works for me

more or less the same except i manage to get by with a string name

“get game mode”