# Can someone tell me why my widget component is failing to cast my widget?

**URL:** <https://forums.unrealengine.com/t/can-someone-tell-me-why-my-widget-component-is-failing-to-cast-my-widget/1910364>\
**Category:** Blueprint\
**Tags:** casting, unreal-engine, Widget, Blueprint, question\
**Created:** [June 20, 2024, 2:59pm UTC](https://forums.unrealengine.com/t/can-someone-tell-me-why-my-widget-component-is-failing-to-cast-my-widget/1910364 "2024-06-20T14:59:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leshrac231](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Leshrac231](https://forums.unrealengine.com/u/Leshrac231)\
**Post date:** [June 20, 2024, 2:59pm UTC](https://forums.unrealengine.com/t/can-someone-tell-me-why-my-widget-component-is-failing-to-cast-my-widget/1910364/1 "2024-06-20T14:59:10Z")

</div>

![image_2024-06-20_213705647](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/b/d/3bd8d8c00aab2d8e8ff60abdb3d51321d2f32449.png)  
first picture is from my actor component, im successing in getting the function i made in my widget component.  
 ![image_2024-06-20_213856562](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/0/4/404c4abcf486cf2eec7b41bf089be9bb8b0fe710.png)  
this is my widget component function. I dont know why but my code is failing to cast my widget and is not succeeding in casting the function from my widget

---

<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:** [June 20, 2024, 3:06pm UTC](https://forums.unrealengine.com/t/can-someone-tell-me-why-my-widget-component-is-failing-to-cast-my-widget/1910364/2 "2024-06-20T15:06:10Z")

</div>

Could you add a Delay of 1s here to test it:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/a/d/aad712089a49c2a7745e74380a3d0e71bca81faa.png)

Does it work now? I am **assuming** you did assign widget class to the component, of course.

---

<div class="post-metadata">

**Author:** ![Leshrac231](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Leshrac231](https://forums.unrealengine.com/u/Leshrac231)\
**Post date:** [July 6, 2024, 7:11am UTC](https://forums.unrealengine.com/t/can-someone-tell-me-why-my-widget-component-is-failing-to-cast-my-widget/1910364/3 "2024-07-06T07:11:44Z")

</div>

I think my fault was I didnt add the healthbar component in my unity component. so I added it after the sequence, and I made it a function so now it works and I dont want to touch it again.

 ![image_2024-07-06_151117526](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/c/6/7c6fe40674eca4cf5fcc36850fe49448c2a7de26.png)

---

<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:** [August 5, 2024, 7:12am UTC](https://forums.unrealengine.com/t/can-someone-tell-me-why-my-widget-component-is-failing-to-cast-my-widget/1910364/4 "2024-08-05T07:12:14Z")

</div>

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