How access variables or actors from level blueprint

I have a blueprint actor within my scene called HoverSwitch. When a player shoots the HoverSwitch the switch changes a variable called FogScale in the level blueprint. FogScale is on tick and each second it changes the fog density either increasing or decreasing depending whether the HoverSwitch is turned on or off. This is my plan. However I haven’t found a way to access the FogScale variable from outside the level blueprint.

I can’t use cast or event dispatchers because I’m not using my character nor can I cast to the level blueprint. I’ve tried setting up an interface but the interface message needs a cast to the level blueprint which it appears I don’t have access to. I can’t use game mode because from there I can’t efficiently access environmental actors such as fog density, sun direction, rayleigh, etc.

The only solution that seems to be feasible is within my HoverSwitch I call all actors of class Sky Atmosphere and use that to get a reference to the Fog Density. However using tick to call all actors for all my environmental actors seems like it would be terribly inefficient.

Is calling actors of class the only solution or is there another way to access world outliner actors or variables from level blueprint?

I’ve searched and searched and still haven’t found a solution to my problem. Please any help I would be extremely grateful, Thanks!

You can setup dispatchers on the level blueprint, but it’s really ugly and not recommended.

Why can’t your switch access the fog actor?

You don’t have to do GetActorOfClass on tick. You only have to do it on begin play and store the reference for later use…

You’re overcomplicating this by an order of magnitude.

Consider the following:

Would that work?

You can, of course, use your own dispatcher:


It’s a bit tricky when dynamically spawned actors need access to the LB: