How to cast to a widget in another widget

Hi,
How can I cast to a widget inside another widget?
I need to call a function from Widget A in Widget B, how can I achieve this?

Thanks :slight_smile:

The best way is to pass around widget references. But you can also just use ‘get all widgets of class’.

1 Like

Hey there @Faze_Kaas! So with widgets you can communicate in the same way you do with actors! However you can get a reference when you first instantiate it and send it where you need from there! This ensures you always have an up to date reference!

Edit: 37 seconds before me @ClockworkOcean! Hahaha you’re awesome.

2 Likes

37.14159265 actually :sunglasses:

1 Like

Hi, @ClockworkOcean @SupportiveEntity thanks for the help.
But the problem I had was not a issue with the casting I see now sorry (I thought it was so I was not sure if I casted correctly but I did it the same as you showed here so that was not the problem)
Thanks for the help anyway! (and showing me my casting was not the problem)