Cast to health widget

Hi,

I’m trying to cast to my health widget on my Health Component so that I can get a reference to my health and stamina bar but can’t seem to get it to work. Obviously the object wildcard is blank in the image but I’m unsure what object it wants.

The widget is created on W_PlayerHUD and the progress bar I want to get is on W_Healthbar
Here are the refs I made that should work but I’m unable to cast

It wants the health stamina widget as the object. The cast node doesn’t get a reference to anything, it just converts to that type if possible.

You can think of casting as asking the object “Are you this class?”. If it is not that class, “Cast Failed” will trigger. If it is, it’ll continue on, and your object will be referenced as a health stamina widget through the “As W Health Stamina” pin.

You need to set the Health Stamina reference when you first create the widget. To create a widget, simply use the Create Widget node off your begin play event, and add the resulting widget to viewport using the node of the same name.