How to use the object pin from cast to?

Hi i want to ask how i must use the Object pin of the Cast to Node cause i have a problem and it seems very fundamentall to know this.
I have a Widget and i want to cast to a save game File from there. The Save Game File is in the Third Person Character BP created as well as the Widget. So what am i supposed to do and WHY?

Casting is not a “Getter” function.

Think of classes as Boxes in a warehouse. Reference Variables point to a specific type of box in a specific spot in the warehouse.

For example say we have 3 boxes (Cardboard, Wood, Metal). Each of these boxes holds very specific contents. Problem is the all look the same. You cannot determine what type of box it is just by looking at it.

Someone hands you a box. To determine what type of box, thus what it contains, you have to look at and examine it. This is what casting does. You have to provide a reference (obj reference) in order for it to determine if its X, Y or Z.

Cast to CardboardBox checks to see if it is a cardboard box. If so (success) it’ll provide a Pointer to that very specific box (as CardboardBox).


In your specific case you’d pass a reference of your character to the widget. Then using that reference get the Save Game File reference.

1 Like

Ok thanks, now i understand it a little bit better, but what should i do in my case?(thats the Part i dont get xD)But thank you for your quick answer!

Where are you loading widgets from? Character or Controller class?