Communicating with Level Blueprint Booleans from Actor

Hello,

I’m trying to solve an issue with a basic sliding door Blueprint.

Short version: Can a Blueprint Actor access a variable (in this case a boolean) that is defined/stored within the Level Blueprint?

Long Version:
I’m working on a game that involves reactivating the systems of a damaged spaceship. Because this project has been a work-in-progress since I started learning Unreal, there’s some aspects which are highly inefficient, and some are downright ugly. It’s basically an enormous collection of experiments to see what I could make.

I set up my level blueprint with a Boolean, MainPowerOn, which is set to false by default. In my current setup,any sliding doors (there’s 6 of them so far) are individual matinees which play forward or reverse in response to BeginOverlap and EndOverlap events. Both events branch from MainPowerOn, thus it must be True in order for the doors to move, and you achieve that through a quick puzzle which ends up setting it to True. Pretty simple.

In an effort to find a better way of doing things, and to force myself to think about Blueprint classes more, I followed the Blueprint Animated Door Tutorial found here and have it working as described. It seems like a much more efficient way of doing things, especially where I have far more instances of sliding doors than I had imagined when I started this.

I’m trying to incorporate a branch for MainPowerOn into the Sliding Door blueprint as I did in the level blueprint. I have made MainPowerOn public, but I feel like I am missing some fundamental concept about Blueprints and the flow of information here. Epic’s guide on blueprint communication seems to be for the opposite of what I’m attempting. Most of the “systems” of the ship hinge on the status of MainPowerOn, and various events in the Level Blueprint flip it from true to false and back multiple times. Beyond that, other booleans will need to be checked for other ship’s systems which rely on each other.

Anyone have an idea?

Yeah. Just grab a reference to the level blueprint and you can access public variables on it from inside another blueprint.

If you want it more robust (and more compatible with other languages), you can setup a getIsMainPowerOn() function that returns a boolean. But thats just mostly redundant if im understanding correctly how blueprints handles interBP communication.

I try not to use level blueprint for anything unless I have to its just a lot harder to work with and there are other classes that provide a lot more functionality besides if you ever need to chsnge levels then it means you need to duplicate everything over into thr new level.

For youre setup you should put all the movent code into a master actor sliding doors blueprint including the boolean. And then cast to it from youre character or whatever and just set the boolean value. For each door you just make a copy of this master bp so it will share all its functionality the only thing that will change is its name.

Thank you both.

6ixpool, some experimenting and subsequent Googling indicates that getting a level blueprint reference within an actor blueprint is not possible, unless I misunderstood you.

EniGmaa, I am indeed trying to minimize the level blueprint now, for exactly that reason. Trying to wrap my head around casting at the moment, but inheritance issues are creating warnings.

One solution that does seem to work is creating an empty Blueprint Actor with MainPowerOn as a boolean, which other actors in the level can access and modify.