How can I display the value of variable on the screen?

Hi! I try to display value of variable GOAT_SAVED from “cage” BP on the screen on HUD but I don’t know how to do that. I tried many ways but nothing works. :confused:

First, your widget blueprint need a reference to your actor (where the variable is).
the easiest way : when you spawn the widget, you can set the owner of the widget, then in the widget you can use “get owning pawn” …

Good luck !

Thanks for answer. When I try to set owner and then compile and play, I have this error.
Can you show me how to do that? I’ ll be very thankful :slight_smile:
105663-

Store your variable someplace where you can get access to it. I store them in my GameMode blueprint (I know it might not be the best place). Then bind a blueprint to the text field in your widget.

Set the owner with the spawn function, where you choose the blueprint to spawn. There is a owner node under !