# Widget component cast not working

**URL:** <https://forums.unrealengine.com/t/widget-component-cast-not-working/301258>\
**Category:** UI\
**Tags:** casting, unreal-engine, Widget, Blueprint, question, UMG\
**Created:** [December 11, 2014, 8:32am UTC](https://forums.unrealengine.com/t/widget-component-cast-not-working/301258 "2014-12-11T08:32:25Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Roel](https://forums.unrealengine.com/u/Roel)\
**Post date:** [December 11, 2014, 8:32am UTC](https://forums.unrealengine.com/t/widget-component-cast-not-working/301258/1 "2014-12-11T08:32:25Z")

</div>

I’m kind of new to Blueprint with UMG, so maybe my thought process is completely wrong here, but this is what I am doing:

1. Created a widget component named “DebugWidget”

2. Set the widget component class type to “DebugWidget”, which is just a simple widget with an image exposed as a variable.

3. Cast the widget component to my DebugWidget so I can retreive the image and change the color of it.

Step 3 is failing and I have absolutely no clue to why this would happen, unless if somehow the widget component holds a reference inside to the DebugWidget, without actually being it…

So how do I do something like this correctly?

 ![23642-widgetcastfail.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/0/e/60eaf236f17850de0261549fe8b6b035ccbfae96.jpeg)

---

<div class="post-metadata">

**Author:** ![Darknoodles](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Darknoodles](https://forums.unrealengine.com/u/Darknoodles)\
**Post date:** [December 16, 2014, 1:14pm UTC](https://forums.unrealengine.com/t/widget-component-cast-not-working/301258/2 "2014-12-16T13:14:12Z")

</div>

I have the same issue. I just need to get a variable and the cast fails every time (when the editor doesn’t crash, as it does every two minutes, for random reason like popping up the context menu in graph…)

I think the 3d widget is just broken currently and we will have to wait for an update.  
If i have something new i’ll let you know.

---

<div class="post-metadata">

**Author:** ![Roel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Roel](https://forums.unrealengine.com/u/Roel)\
**Post date:** [January 5, 2015, 8:08pm UTC](https://forums.unrealengine.com/t/widget-component-cast-not-working/301258/3 "2015-01-05T20:08:18Z")

</div>

Bump! Anyone?

---

<div class="post-metadata">

**Author:** ![AgentMilkshake1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AgentMilkshake1](https://forums.unrealengine.com/u/AgentMilkshake1)\
**Post date:** [January 19, 2015, 1:55pm UTC](https://forums.unrealengine.com/t/widget-component-cast-not-working/301258/4 "2015-01-19T13:55:39Z")

</div>

Hi there,

I was having the exact same problem, and I found your question while trying to find a solution.

I managed to get it working (YAY!). Basically, I was trying to cast the Widget Component in my blueprint the original Widget Blueprint.

When I was trying to get it working I just typed in “widget” into the context menu and found “Get User Widget Object”.

I then plugged this into the cast as you had previously done and it worked. 🙂

On your one, just replace “Debug Widget” Widget Component with “Get User Widget Object”. Hopefully it should work.

Here is a picture below, and it works! Let me know how you get on.

 ![27166-widget+cast.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/1/b/f1b4b81dc7b45d8f6fcc5d53a0d795c9e4c9f12b.jpeg)

All the best! 🙂

---

<div class="post-metadata">

**Author:** ![Roel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Roel](https://forums.unrealengine.com/u/Roel)\
**Post date:** [January 26, 2015, 6:16pm UTC](https://forums.unrealengine.com/t/widget-component-cast-not-working/301258/5 "2015-01-26T18:16:19Z")

</div>

You’re a hero!

---

<div class="post-metadata">

**Author:** ![PremiereBoris](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PremiereBoris](https://forums.unrealengine.com/u/PremiereBoris)\
**Post date:** [April 4, 2015, 4:14pm UTC](https://forums.unrealengine.com/t/widget-component-cast-not-working/301258/6 "2015-04-04T16:14:23Z")

</div>

I know this is late, but thank you.

---

<div class="post-metadata">

**Author:** ![MykonCodes](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MykonCodes](https://forums.unrealengine.com/u/MykonCodes)\
**Post date:** [May 16, 2015, 11:30am UTC](https://forums.unrealengine.com/t/widget-component-cast-not-working/301258/7 "2015-05-16T11:30:05Z")

</div>

Thaaaaanks!

---

<div class="post-metadata">

**Author:** ![AgentMilkshake1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AgentMilkshake1](https://forums.unrealengine.com/u/AgentMilkshake1)\
**Post date:** [April 21, 2016, 12:52pm UTC](https://forums.unrealengine.com/t/widget-component-cast-not-working/301258/8 "2016-04-21T12:52:53Z")

</div>

Hey Roel, could you mark this off as the Answer 🙂 thanks

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_29d39a36](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_29d39a36](https://forums.unrealengine.com/u/anonymous_user_29d39a36)\
**Post date:** [October 10, 2016, 12:57pm UTC](https://forums.unrealengine.com/t/widget-component-cast-not-working/301258/9 "2016-10-10T12:57:50Z")

</div>

Thanks man, i was really bugged by this!

---

<div class="post-metadata">

**Author:** ![BrunoChaves](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BrunoChaves](https://forums.unrealengine.com/u/BrunoChaves)\
**Post date:** [June 21, 2017, 2:53pm UTC](https://forums.unrealengine.com/t/widget-component-cast-not-working/301258/10 "2017-06-21T14:53:44Z")

</div>

Doesn´t have this “Get User Widget Object” option in my case. I´m trying to cast a widget from another widget, anyone maths with the option you mentioned.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_4030fea0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4030fea0](https://forums.unrealengine.com/u/anonymous_user_4030fea0)\
**Post date:** [February 10, 2018, 5:10am UTC](https://forums.unrealengine.com/t/widget-component-cast-not-working/301258/11 "2018-02-10T05:10:12Z")

</div>

+1 on the answer

---

<div class="post-metadata">

**Author:** ![gnoumph](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gnoumph](https://forums.unrealengine.com/u/gnoumph)\
**Post date:** [September 16, 2018, 6:49pm UTC](https://forums.unrealengine.com/t/widget-component-cast-not-working/301258/12 "2018-09-16T18:49:53Z")

</div>

Yay! Thanks dude 😃

---

<div class="post-metadata">

**Author:** ![Raycng](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Raycng](https://forums.unrealengine.com/u/Raycng)\
**Post date:** [October 30, 2018, 2:45pm UTC](https://forums.unrealengine.com/t/widget-component-cast-not-working/301258/13 "2018-10-30T14:45:39Z")

</div>

Thank you so much!

---

<div class="post-metadata">

**Author:** ![Zexus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zexus](https://forums.unrealengine.com/u/Zexus)\
**Post date:** [February 26, 2019, 10:00am UTC](https://forums.unrealengine.com/t/widget-component-cast-not-working/301258/14 "2019-02-26T10:00:05Z")

</div>

Same, I can’t find it too!

---

<div class="post-metadata">

**Author:** ![Nebula\_Games\_Inc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nebula\_Games\_Inc](https://forums.unrealengine.com/u/Nebula_Games_Inc)\
**Post date:** [March 1, 2019, 4:46am UTC](https://forums.unrealengine.com/t/widget-component-cast-not-working/301258/15 "2019-03-01T04:46:25Z")

</div>

This may help. Shows how to get widget references from other widgets. The trick is to find out where the widget was “created” and store it as a variable you can access from other BPs. I also explain the “get user widget object” node, as it isn’t clear from the above screen shot.

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/e/4/fe4b2e9c40e1e16aa5665ad37d7a46af017e25e5.jpeg "Unreal Engine 4 Tutorial: Widget to Widget Communication") ](https://www.youtube.com/watch?v=BdARbvNrvQE)

---

<div class="post-metadata">

**Author:** ![araz01](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/araz01/32/1028814_2.png) [@araz01](https://forums.unrealengine.com/u/araz01)\
**Post date:** [October 9, 2021, 8:45pm UTC](https://forums.unrealengine.com/t/widget-component-cast-not-working/301258/16 "2021-10-09T20:45:35Z")

</div>

And If This Doesnt Work, Create A Widget (Add Component: Widget) IN The Enemy BP For Example, Then Assign That Widget That Widget BP Your Trying To Access, Then Use That Then Draw A Get User Widget Object Then Attach To Cast To That Widget BP, Then It Will Work, BRU!  
Was Trying To Call An Int From A Widget Bp, To Check Which Death Anim The Enemy Should Play Upon Being Shot With The Right Character/Gun, Works, BRU!

---

<div class="post-metadata">

**Author:** ![KychrisYang](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KychrisYang](https://forums.unrealengine.com/u/KychrisYang)\
**Post date:** [December 28, 2023, 8:57pm UTC](https://forums.unrealengine.com/t/widget-component-cast-not-working/301258/17 "2023-12-28T20:57:39Z")

</div>

solved my issue! thank you so much!

---

<div class="post-metadata">

**Author:** ![dangoes2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dangoes2](https://forums.unrealengine.com/u/dangoes2)\
**Post date:** [March 22, 2024, 4:36pm UTC](https://forums.unrealengine.com/t/widget-component-cast-not-working/301258/18 "2024-03-22T16:36:17Z")

</div>

I don’t understand why it works but, this led me to trying to first cast to `UserWidget` BEFORE casting to my final widget class… and THAT worked.
