Get Owning Player Pawn returns none on Widget attached to component
I have a widget that sets player's health bar. I use Get Owning Player Pawn to retrieve my Base Character in which I later use in my bind method to do Health Logic for the UI.
This works when the widget is set up to a HUD object which is then set as the HUD in the game mode. However when I assign the widget to a WidgetComponent, the Get Owning Player Pawn always returns "none".
Is there something special I need to do in this case? Any help would be much appreciated!
asked Mar 26 '18 at 07:43 PM in Blueprint Scripting
I have had this issue before, I forget exactly what I did but I believe you have to drag the widget component out into the editor and then from that say "get user widget object" I believe is the node and that gets an actual instance of the user widget.
I'd suggest an alternative approach. Create a variable of type HeroCharacter in your widget BP, and set it when the widget is constructed and added to viewport. That way you'll always ensure that the value doesn't come to null
answered Mar 27 '18 at 08:10 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here