Download

Widget BP to Widget BP problem

I’m into a widget BP and I have to cast to another widget BP to retrieve variables.
The problem is that when I cast to BP_HUD the “object” always gave me error. I’ve been trying using Player controller - > get HUD, player pawn, everythngs… but nothing
How can I easily do that please?

Hello, can you please upload a screenshot of the part of your blueprint that is failing, along with the error message? Thanks.


Ok sure, this is the error, and it doesn’t work

The HUD you’re attempting to retrieve from the controller has nothing to do with widgets. Could you explain what BPW_HUD is, exactly, and where it is created (if it’s a widget)? At some point you probably go Create Widget -> BPW_HUD. In which blueprint does this take place?

Judging by what’s shown, and the unfriendly warning, you’re attempting to treat the venerable HUD class as if it was a mere widget. That’s not gonna cut it :wink:

1 Like

Thank you , BPW_HUD is a widget and it is the main game interface.
I’m retrieving this by the BP_Player that is basically the main Blueprint of the player.
Is that a approach to do that?

I’m retrieving this by the BP_Player that is basically the main Blueprint of the player.

Not entirely sure I understood you right but it seems that you create the BPW_HUD widget in the player blueprint, correct? In which case:

Get Player Character (or pawn) → Cast To Your Character (or pawn) → Get the reference of the widget the player created.


Assuming you did this in the player:

image

Thank you very much Everynone, but the best way has been retrieving the HUD from BP_Player so:

BP_Player → BP_Hud → InventoryStructure

:slight_smile: , now I have to face another problem… tomorrow