# How access variables or actors from level blueprint

**URL:** <https://forums.unrealengine.com/t/how-access-variables-or-actors-from-level-blueprint/482190>\
**Category:** UI\
**Tags:** actor-blueprint, interfaces, reference-blueprint, unreal-engine, level-blueprint, question\
**Created:** [April 20, 2021, 8:23am UTC](https://forums.unrealengine.com/t/how-access-variables-or-actors-from-level-blueprint/482190 "2021-04-20T08:23:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ProgrammingPaul](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ProgrammingPaul](https://forums.unrealengine.com/u/ProgrammingPaul)\
**Post date:** [April 20, 2021, 8:23am UTC](https://forums.unrealengine.com/t/how-access-variables-or-actors-from-level-blueprint/482190/1 "2021-04-20T08:23:55Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [April 20, 2021, 8:40am UTC](https://forums.unrealengine.com/t/how-access-variables-or-actors-from-level-blueprint/482190/2 "2021-04-20T08:40:41Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 20, 2021, 8:48am UTC](https://forums.unrealengine.com/t/how-access-variables-or-actors-from-level-blueprint/482190/3 "2021-04-20T08:48:45Z")

</div>

You’re overcomplicating this by an order of magnitude.

Consider the following:

 ![336454-screenshot-1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/4/8/a4870976b0fe51945eb4a6893c8d263e01b25117.png)

Would that work?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 20, 2021, 8:58am UTC](https://forums.unrealengine.com/t/how-access-variables-or-actors-from-level-blueprint/482190/4 "2021-04-20T08:58:01Z")

</div>

You can, of course, use your own dispatcher:

 ![336456-screenshot-2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/f/5/1f548e6ec7beb9fc7b68e77f27ba8f913ff1d825.png)

* * *

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

> [@Event Dispacther from NON player BP and Level Blueprint](https://forums.unrealengine.com/t/event-dispacther-from-non-player-bp-and-level-blueprint/213409/12):
>
> some actor sending data; it has yet to be instantiated [one] Game Instance receiving and sending data [two] below, something spawns ActorAs we register the ActorA’s ED Send Data dispatcher with the Game Instance’s Custom Event you must ensure the data signatures match (here, there’s no data) and the Level Blueprint goes brrrr
