# how to create a reference to a widget blueprint instance that other blueprints can use to access variables of the widget blueprint instance

**URL:** <https://forums.unrealengine.com/t/how-to-create-a-reference-to-a-widget-blueprint-instance-that-other-blueprints-can-use-to-access-variables-of-the-widget-blueprint-instance/1867237>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [May 22, 2024, 5:39am UTC](https://forums.unrealengine.com/t/how-to-create-a-reference-to-a-widget-blueprint-instance-that-other-blueprints-can-use-to-access-variables-of-the-widget-blueprint-instance/1867237 "2024-05-22T05:39:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![barbrian0723](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@barbrian0723](https://forums.unrealengine.com/u/barbrian0723)\
**Post date:** [May 22, 2024, 5:39am UTC](https://forums.unrealengine.com/t/how-to-create-a-reference-to-a-widget-blueprint-instance-that-other-blueprints-can-use-to-access-variables-of-the-widget-blueprint-instance/1867237/1 "2024-05-22T05:39:24Z")

</div>

Hi  
How do you create a reference (as global or visible variable) to a widget or widget blueprint that other blueprints can use to access variables of an instance of such a widget / blueprint class?  
When I create and set a variable that is a reference to an actor / blueprint class, other blueprints can read / get that variable / reference and use it to reference the variables of the blueprint pointed to  
when i try the same for / with a widget blueprint, i end up with target issues when i compile, when other blueprints try to reference global variables of that widget blueprint via the instance reference provided  
for an actor or instance of a blueprint class, other blueprints can read the reference variable set by the former without it requiring a target  
when i do this for a widget blueprint it requires a target and it becomes circular as the reference i provide is seemingly not enough  
for blueprint classes i generally set a global variable after an actor spawn. for the widget blueprint i attempt the same by setting a global variable by means of a reference to self  
thanks

---

<div class="post-metadata">

**Author:** ![lordlolek](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lordlolek/32/906205_2.png) [@lordlolek](https://forums.unrealengine.com/u/lordlolek)\
**Post date:** [May 22, 2024, 10:19am UTC](https://forums.unrealengine.com/t/how-to-create-a-reference-to-a-widget-blueprint-instance-that-other-blueprints-can-use-to-access-variables-of-the-widget-blueprint-instance/1867237/2 "2024-05-22T10:19:36Z")

</div>

If I create widget and store it in a variable, I can then access it’s variables without a problem.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/4/c/b4c061413244f84d7eb007d94326363298a750d0.png)

Maybe make sure your widget is stored as your actual Widget Class, not a generic User Widget or something  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/5/f/c5f91075af4be255c8e1651872e402dd1177a729.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:** [May 22, 2024, 10:27am UTC](https://forums.unrealengine.com/t/how-to-create-a-reference-to-a-widget-blueprint-instance-that-other-blueprints-can-use-to-access-variables-of-the-widget-blueprint-instance/1867237/3 "2024-05-22T10:27:57Z")

</div>

As above; and regarding making it _global_ - there is not such thing in UE, not for this kind of behaviour. What people generally do is to keep a reference in a singleton framework class - game mode, pawn, controller. The HUD class is not choice for a widget manager ← it’s accessible from anywhere via the Player Controller.

---

<div class="post-metadata">

**Author:** ![barbrian0723](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@barbrian0723](https://forums.unrealengine.com/u/barbrian0723)\
**Post date:** [May 22, 2024, 10:49am UTC](https://forums.unrealengine.com/t/how-to-create-a-reference-to-a-widget-blueprint-instance-that-other-blueprints-can-use-to-access-variables-of-the-widget-blueprint-instance/1867237/4 "2024-05-22T10:49:08Z")

</div>

thanks. i have indeed checked that i referenced the variable type / class correctly  
i still need to check whether what you have done fully corresponds to what i have done and whether it points to a possible error my side and thus a solution  
one thing i can say that i have done that you have not done is that i reference from a different blueprint and you reference from within the same blueprint it seems  
target is more of an issue when you reference from another blueprint

---

<div class="post-metadata">

**Author:** ![barbrian0723](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@barbrian0723](https://forums.unrealengine.com/u/barbrian0723)\
**Post date:** [May 22, 2024, 10:58am UTC](https://forums.unrealengine.com/t/how-to-create-a-reference-to-a-widget-blueprint-instance-that-other-blueprints-can-use-to-access-variables-of-the-widget-blueprint-instance/1867237/5 "2024-05-22T10:58:05Z")

</div>

thanks  
by global i mean visible to other blueprints etc. i still need to adapt to ue language  
the workaround at this point is to use a “get all widgets of class” node, seeing that there is only 1 instance of that particular widget blueprint active  
perhaps referencing it in this way is a step closer to what you suggest

---

<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:** [May 22, 2024, 11:12am UTC](https://forums.unrealengine.com/t/how-to-create-a-reference-to-a-widget-blueprint-instance-that-other-blueprints-can-use-to-access-variables-of-the-widget-blueprint-instance/1867237/6 "2024-05-22T11:12:30Z")

</div>

> [@barbrian0723](#):
>
> by global i mean visible to other blueprints

They’re always visible, by default, you just need to know where to look for references, which you must create yourself.

> [@barbrian0723](#):
>
> the workaround at this point is to use a “get all widgets of class” node, seeing that there is only 1 instance of that particular widget blueprint active

This is not even a workaround. Dereferenced widgets will be Garbage Collected. And you must handle comms somehow anyway since 90% of your code base is moving data from A → B.

* * *

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

There’s usually no need to use Interface communication here. You will need a Game Mode & HUD. This also assumes what @lordlolek shows in his post. There are many ways to handle it, ofc.

---

<div class="post-metadata">

**Author:** ![barbrian0723](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@barbrian0723](https://forums.unrealengine.com/u/barbrian0723)\
**Post date:** [May 23, 2024, 1:59am UTC](https://forums.unrealengine.com/t/how-to-create-a-reference-to-a-widget-blueprint-instance-that-other-blueprints-can-use-to-access-variables-of-the-widget-blueprint-instance/1867237/7 "2024-05-23T01:59:12Z")

</div>

thanks will look into it

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [June 22, 2024, 2:30am UTC](https://forums.unrealengine.com/t/how-to-create-a-reference-to-a-widget-blueprint-instance-that-other-blueprints-can-use-to-access-variables-of-the-widget-blueprint-instance/1867237/9 "2024-06-22T02:30:24Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
