Download

Level reference

I want to reach all level details (childs, variables, functions…) outside of my level.

Event dispatcher or gameinstance is not useful for me.
I cant find castto…mylevel… solution

Is there a way to reference to my level for use everything in my level ?

Best regards…

I think my first question would be ‘why?..’

But having said that, I think you might get somewhere with level streaming and just not setting the level to visible.

Apart from that it might be a brick wall you’re looking at, unless you want to start rummaging around in C++.

@BAYRAM_GUVEN

Best Advice would be stay out of the Level BP - I know that sounds strange but it’s hard to access from & to the Level BP so for anyone starting or anyone basically it would be advised just to stay away from it for the most part.

an exception would be something like a door BP that opens on it’s own when something enters the trigger box which you can do an Event (lower right side in a BP to select an Event such as Begin Overlap etc) then cast to see if it’s the Pawn or Player Character and/or some condition has been met but still such a BP really isn’t communicating with the actual Level BP it just exists in it.

to keep from being too confusing try watching this Video: https://www.youtube.com/watch?v=EM_HYqQdToE
( I know it was done in 2015 but it covers a lot of basics that all should work )( it should help you a lot)

Good Luck with your Journey in Unreal !! :slight_smile:

Thanks.

I have a AI (on a Player blueprint) I must use mylevel variables and functions on the AI (AI controller)

Yeah, you can only do that with the level open.

You either need to have code in each level BP that’s appropriate to the level ( not so weird ), or put your code somewhere else, like in the the player controller.

If you’re trying to access some functions used in your level blueprint, you could possibly move those functions to their own class/function library blueprint then create an instance of this class to use in your level and player blueprints to access that functionality.

If you want to access some variable values that are used in the level when it’s loaded/initialised, you could use a “parameter collection” to set the initial values in your level that you can then also access from your player blueprint.

If you want to access some variable/state values in your level that might change during gameplay, might be an idea to save those values to a save file, or a save structure in Game Instance if you only want to save that data for as long as the game is running.