# Reference to blueprint from widget

**URL:** <https://forums.unrealengine.com/t/reference-to-blueprint-from-widget/2219424>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [December 14, 2024, 5:37am UTC](https://forums.unrealengine.com/t/reference-to-blueprint-from-widget/2219424 "2024-12-14T05:37:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deadlyo0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Deadlyo0](https://forums.unrealengine.com/u/Deadlyo0)\
**Post date:** [December 14, 2024, 5:37am UTC](https://forums.unrealengine.com/t/reference-to-blueprint-from-widget/2219424/1 "2024-12-14T05:37:03Z")

</div>

I have Blueprint, in which I move the camera to a different position.  
This is created through a custom event.  
This part works correctly.

In addition, I have a Widget in which there is a button to move this camera, in the same widget file I have an object reference variable to call a function from the blueprint file (another file)

The problem is that I cannot select “Default Value” to point to the blueprint file.  
Because in Outliner I have this blueprint as main and in it child widget and it is in the widget that there is no option for selecting the file.

The first picture shows what I mean.  
At the same time, this is the aforementioned blueprint and under it is a widget.  
Blueprint communicates with another file without any problem

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/f/6/8f6e2127f08812d3148f5d75a774c3aa42784ea4.png)

Here we have a widget enabled, where I can not select the same option.

Due to which when I click on the widget button I get an error  
“Blueprint Runtime Error: “Accessed None trying to read property As BP\_Widget\_MainMenu. Node: Camera Move Level Select Graph: EventGraph Function: Execute Ubergraph WBP Main Menu Blueprint: WBP\_MainMenu”

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/e/3/6e3fb5e4dad415ac17bed72c4c627893dec508b8.png)

---

<div class="post-metadata">

**Author:** ![Deadlyo0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Deadlyo0](https://forums.unrealengine.com/u/Deadlyo0)\
**Post date:** [December 14, 2024, 5:39am UTC](https://forums.unrealengine.com/t/reference-to-blueprint-from-widget/2219424/2 "2024-12-14T05:39:19Z")

</div>

Pic from editor, where is “NONE” as object reference  
I can’t edit it

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/b/2/fb2392274567174d9226d9b495e8d4a3e9a390ff.png)

---

<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:** [December 14, 2024, 9:04am UTC](https://forums.unrealengine.com/t/reference-to-blueprint-from-widget/2219424/3 "2024-12-14T09:04:05Z")

</div>

> [@Deadlyo0](#):
>
> I can’t edit it

That’s pretty normal. A behaviour like this is best (there are many ways, though) achieved through a delegate. You do not need this part:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/2/6/e262224482aa4a126f0d14645671205b0953f1e1.png)

Instead:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/e/1/4e15ef8fe816ede2b38050c4af9c4e9c84aa4b3b.png)

The above translates to - whenever a button is clicked, execute a custom event in this actor. You can instruct the BP Camera Level what to do.

* * *

Note, we can take it further and make it better by implementnig a custom Event Dispatcher in the widget - this way each button can send unique data. And we can execute an event in **another actor** (BP\_CameraLevel) directly:

- we receive a notification in the BP Camera Level

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/3/2/c321e2bb74131009fedd38f3cce8f508b25814a6.png)

- in the widget, each button click dispatches unique data:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/e/c/0ec1a7df3d70fdeecb11c89dfe30060ea6e22cc6.png)

- in the main menu actor that hosts the widget component:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/2/9/0298d7a1cf48da9bfc72a1e4d364513348357c22.png)

In short: whenever a widget button is clicked, the BP Camera Level actor receives a notification (and data).
