# How can i get variable from UMG Widget blueprint, in other blueprints ?

**URL:** <https://forums.unrealengine.com/t/how-can-i-get-variable-from-umg-widget-blueprint-in-other-blueprints/11592>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [September 18, 2014, 6:58am UTC](https://forums.unrealengine.com/t/how-can-i-get-variable-from-umg-widget-blueprint-in-other-blueprints/11592 "2014-09-18T06:58:04Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![K-o-r-a-x](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/k-o-r-a-x/32/465085_2.png) [@K-o-r-a-x](https://forums.unrealengine.com/u/K-o-r-a-x)\
**Post date:** [September 18, 2014, 6:58am UTC](https://forums.unrealengine.com/t/how-can-i-get-variable-from-umg-widget-blueprint-in-other-blueprints/11592/1 "2014-09-18T06:58:04Z")

</div>

Guys i need your help, i create “Editable text box” and “button” on widget blueprint, after this i made an event “on button click”, to store text from editable text box. Now the question: how can i get this variable on other blueprints ? for example on “MyCharacter”

---

<div class="post-metadata">

**Author:** ![NickDarnell](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NickDarnell](https://forums.unrealengine.com/u/NickDarnell)\
**Post date:** [September 18, 2014, 1:07pm UTC](https://forums.unrealengine.com/t/how-can-i-get-variable-from-umg-widget-blueprint-in-other-blueprints/11592/2 "2014-09-18T13:07:19Z")

</div>

You need to assign the MyCharacter to a variable in the GUI so it has access to it just like normal blueprints. When you construct the widgets you can also assign them a player controller. Then you can access the player controller on the GUI cast it to your particular type, and then get information like the character pawn, or player health…etc.

Cheers,  
Nick

---

<div class="post-metadata">

**Author:** ![K-o-r-a-x](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/k-o-r-a-x/32/465085_2.png) [@K-o-r-a-x](https://forums.unrealengine.com/u/K-o-r-a-x)\
**Post date:** [September 19, 2014, 9:14am UTC](https://forums.unrealengine.com/t/how-can-i-get-variable-from-umg-widget-blueprint-in-other-blueprints/11592/3 "2014-09-19T09:14:34Z")

</div>

If I understand you correctly, I made a couple of screenshots to show the result.  
This is example of my event.  
 ![d8e5a87c54cf10cf9ccc59038cc4c1d89e8bff7d.jpeg](https://d1ap1mz92jnks1.cloudfront.net/images/transparent.png)  
This is some errors in log after i try it in game.  
 ![8dd1563705b68e5f95bb564f11b7527bfc090006.jpeg](https://d1ap1mz92jnks1.cloudfront.net/images/transparent.png)

Help me with this, what did I do wrong? It looks very simple, but I’m trying to figure it out for several days, and there are no results.

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [September 19, 2014, 9:23am UTC](https://forums.unrealengine.com/t/how-can-i-get-variable-from-umg-widget-blueprint-in-other-blueprints/11592/4 "2014-09-19T09:23:39Z")

</div>

**Casting**

I posted a complete tutorial that shows interaction between UMG widget blueprints and the My Character blueprint, it has lots of pics!

> **[Rama's UMG Tutorial: Create a Scrollable List of Buttons From a Dynamic Array](https://forums.unrealengine.com/showthread.php?42286-Rama-s-UMG-Tutorial-Create-a-Scrollable-List-of-Buttons-From-a-Dynamic-Array&p=146513&viewfull=1#post146513)**
>
> Dear Community, In this entirely BP tutorial I show you how you can make a scrollable list of clickable buttons from a String array on key press from the Character BP! You can run any BP code you want when any of the buttons are pressed! The power...

As you will see in my tutorial you need to cast your UMG widgets and then access the variables of each of your widget elements.

So there are a series of casts involved!

If you walk through my whole tutorial you will have the answer to your question when you are done!

Rama

---

<div class="post-metadata">

**Author:** ![K-o-r-a-x](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/k-o-r-a-x/32/465085_2.png) [@K-o-r-a-x](https://forums.unrealengine.com/u/K-o-r-a-x)\
**Post date:** [September 19, 2014, 10:22am UTC](https://forums.unrealengine.com/t/how-can-i-get-variable-from-umg-widget-blueprint-in-other-blueprints/11592/5 "2014-09-19T10:22:16Z")

</div>

Thank you, you helped me a lot!

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [September 19, 2014, 11:54am UTC](https://forums.unrealengine.com/t/how-can-i-get-variable-from-umg-widget-blueprint-in-other-blueprints/11592/6 "2014-09-19T11:54:28Z")

</div>

> [@Div1ne Duck;146707](#):
>
> Thank you, you helped me a lot!

Yay!

🙂

🙂

🙂

Rama

---

<div class="post-metadata">

**Author:** ![soulmapp](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@soulmapp](https://forums.unrealengine.com/u/soulmapp)\
**Post date:** [September 19, 2014, 11:55am UTC](https://forums.unrealengine.com/t/how-can-i-get-variable-from-umg-widget-blueprint-in-other-blueprints/11592/7 "2014-09-19T11:55:16Z")

</div>

> [@Rama;146672](#):
>
> **Casting**
> 
> I posted a complete tutorial that shows interaction between UMG widget blueprints and the My Character blueprint, it has lots of pics!
> 
> ['s UMG Tutorial: Create a Scrollable List of Buttons From a Dynamic Array - Community & Industry Discussion - Epic Developer Community Forums](https://forums.unrealengine.com/showthread.php?42286-Rama-s-UMG-Tutorial-Create-a-Scrollable-List-of-Buttons-From-a-Dynamic-Array&p=146513&viewfull=1#post146513)
> 
> As you will see in my tutorial you need to cast your UMG widgets and then access the variables of each of your widget elements.
> 
> So there are a series of casts involved!
> 
> If you walk through my whole tutorial you will have the answer to your question when you are done!
> 
> Rama

How about firing a custom event in a actor class blueprint… from UMG

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [September 19, 2014, 4:22pm UTC](https://forums.unrealengine.com/t/how-can-i-get-variable-from-umg-widget-blueprint-in-other-blueprints/11592/8 "2014-09-19T16:22:07Z")

</div>

> [@soulmapp;146794](#):
>
> How about firing a custom event in a actor class blueprint… from UMG

That is in my tutorial as well!

> **['s UMG Tutorial: Create a Scrollable List of Buttons From a Dynamic Array](https://forums.unrealengine.com/showthread.php?42286-Rama-s-UMG-Tutorial-Create-a-Scrollable-List-of-Buttons-From-a-Dynamic-Array&p=146513&viewfull=1#post146513)**
>
> Dear Community, In entirely BP tutorial I show you how you can make a scrollable list of clickable buttons from a String array on key press from the Character BP! You can run any BP code you want when any of the buttons are pressed! The power of...

Check out the section about binding the button Event!

[https://wiki.unrealengine.com/UMG,\_Create\_Scrollable\_List\_of\_Clickable\_Buttons\_From\_Dynamic\_Array#Create\_Bind\_Event](https://wiki.unrealengine.com/UMG,_Create_Scrollable_List_of_Clickable_Buttons_From_Dynamic_Array#Create_Bind_Event)

You can put any BP code you want there!

To get the actor so you can fire the event you have many options

1. create a variable in the UMG BP, for your actor, and set the variable when the UMG widget is created, wherever it is created.

2. use BP interface

3. Get All Actors of Class, and find the one you want by name

I would tend to prefer option 1, assuming you create the UMG widget in your level BP or your My Character BP, you should be able to set the var on your UMG widget right there!

🙂

Rama

---

<div class="post-metadata">

**Author:** ![K-o-r-a-x](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/k-o-r-a-x/32/465085_2.png) [@K-o-r-a-x](https://forums.unrealengine.com/u/K-o-r-a-x)\
**Post date:** [September 19, 2014, 5:45pm UTC](https://forums.unrealengine.com/t/how-can-i-get-variable-from-umg-widget-blueprint-in-other-blueprints/11592/9 "2014-09-19T17:45:04Z")

</div>

Rama, one more question, when i create widget on level bp, i must casting it on my character bp ?

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [September 20, 2014, 2:20am UTC](https://forums.unrealengine.com/t/how-can-i-get-variable-from-umg-widget-blueprint-in-other-blueprints/11592/10 "2014-09-20T02:20:24Z")

</div>

> [@Div1ne Duck;146952](#):
>
> Rama, one more question, when i create widget on level bp, i must casting it on my character bp ?

Can you show a picture of your question, or explain more?

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [September 20, 2014, 6:54am UTC](https://forums.unrealengine.com/t/how-can-i-get-variable-from-umg-widget-blueprint-in-other-blueprints/11592/11 "2014-09-20T06:54:22Z")

</div>

**UMG Tutorial Update**

I updated my UMG tutorial to answer an important question!

So I now have a FAQ section 🙂

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

Rama

---

<div class="post-metadata">

**Author:** ![K-o-r-a-x](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/k-o-r-a-x/32/465085_2.png) [@K-o-r-a-x](https://forums.unrealengine.com/u/K-o-r-a-x)\
**Post date:** [September 20, 2014, 10:09am UTC](https://forums.unrealengine.com/t/how-can-i-get-variable-from-umg-widget-blueprint-in-other-blueprints/11592/12 "2014-09-20T10:09:40Z")

</div>

I’m trying to understand this problem for about a week, and no results.  
But it should be easy, I just need to understand the logic. I need to assign a variable from UMG, to the variable of MyCharacter. Help me man! :C  
There some pics, with my problem.

This is button click event.  
 ![833420f52445618fa9809977f324be0f8ea147d7.jpeg](https://d1ap1mz92jnks1.cloudfront.net/images/transparent.png)

This is how i create widget and add to viewport.  
 ![54d22f5aa784085787769ff5b997abd3978ce98b.jpeg](https://d1ap1mz92jnks1.cloudfront.net/images/transparent.png)

And this is how i set the “name variable” of my character. I know about casting, but what should i cast and on what ?  
 ![0c59a5476f515607f7ab9ada4228c44d52f63fa3.jpeg](https://d1ap1mz92jnks1.cloudfront.net/images/transparent.png)

☹

---

<div class="post-metadata">

**Author:** ![K-o-r-a-x](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/k-o-r-a-x/32/465085_2.png) [@K-o-r-a-x](https://forums.unrealengine.com/u/K-o-r-a-x)\
**Post date:** [September 23, 2014, 6:36am UTC](https://forums.unrealengine.com/t/how-can-i-get-variable-from-umg-widget-blueprint-in-other-blueprints/11592/13 "2014-09-23T06:36:48Z")

</div>

Bump. 🙂 still need your help guys.

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [September 23, 2014, 10:52pm UTC](https://forums.unrealengine.com/t/how-can-i-get-variable-from-umg-widget-blueprint-in-other-blueprints/11592/14 "2014-09-23T22:52:58Z")

</div>

I do actually show how to communicate between My Character BP and UMG in my tutorial

> **[Rama's UMG Tutorial: Create a Scrollable List of Buttons From a Dynamic Array](https://forums.unrealengine.com/showthread.php?42286-Rama-s-UMG-Tutorial-Create-a-Scrollable-List-of-Buttons-From-a-Dynamic-Array)**
>
> Dear Community, In this entirely BP tutorial I show you how you can make a scrollable list of clickable buttons from a String array on key press from the Character BP! You can run any BP code you want when any of the buttons are pressed! The power...

you need to save a casted version of your UMG widget in your Character BP to then get/set its vars

You should look closely at my pics in my tutorial!

Beyond that I do offer tutoring services:

> **[Rama Available, Counseling, Steam/Multiplayer Code, UI, C++ Game Mechanics](https://forums.unrealengine.com/showthread.php?17178-LFW-PAID-Rama-Available-Counseling-Steam-Multiplayer-Code-UI-C-Game-Mechanics)**
>
> Dear Community, I am offering two broad services: 1. Counseling by Phone / Email 2. Contracted Work to do C++ Coding (Creation of Plugins for Blueprints Included) \*\*Client Testimonials All links are to posts within this thread! \*\* ...

Rama

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_546c4d00](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_546c4d00](https://forums.unrealengine.com/u/anonymous_user_546c4d00)\
**Post date:** [January 24, 2016, 5:13pm UTC](https://forums.unrealengine.com/t/how-can-i-get-variable-from-umg-widget-blueprint-in-other-blueprints/11592/15 "2016-01-24T17:13:09Z")

</div>

I try to understand the same thing, but can’t use casts because I did not generate the Widget in the graph Editor,  
instead I placed the widget into another Widget in the Designer which seems to work out. But now I have a button inside  
one Widget and if that is being pressed, it should deactivate a Widget and activate another one instead.  
I have Boolean vars to set if the Widget is active or inactive, but don’t know how to access those Variables from another  
Widget. Can please someone explain it a bit so a newbie would understand it ? Until now in this thread there are only  
fragments of information that seem to make no sense.

---

<div class="post-metadata">

**Author:** ![Oink\_Oink](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Oink\_Oink](https://forums.unrealengine.com/u/Oink_Oink)\
**Post date:** [February 10, 2016, 8:38pm UTC](https://forums.unrealengine.com/t/how-can-i-get-variable-from-umg-widget-blueprint-in-other-blueprints/11592/16 "2016-02-10T20:38:13Z")

</div>

same here,

i have 3 blueprints  
2 master items blueprints and my main Hud in UMG

I got buttons in my masters blueprints. Those masters are placed in my main HUD.

I want to affect other UMG Blueprint when i press button.  
But i cant cast to other blueprint because i dont understand it 😉

i need help too

---

<div class="post-metadata">

**Author:** ![Oink\_Oink](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Oink\_Oink](https://forums.unrealengine.com/u/Oink_Oink)\
**Post date:** [February 10, 2016, 8:45pm UTC](https://forums.unrealengine.com/t/how-can-i-get-variable-from-umg-widget-blueprint-in-other-blueprints/11592/17 "2016-02-10T20:45:36Z")

</div>

i read the tut on the top of the post,

so i need to cast my widget action into a actor variable by set it ?

 ![700px-CreateJoyUI.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/a/f/af0b6c95b511cfef2b9b58a6afa8197b99403bef.jpeg)
