I have gone over the inventory system tutorial and the UMG in the content example. I need help taking a value in my player blueprint and cast it to my widget to display it in my text block. How can I achieve this?
There are two main ways to do this.
You will need a reference to the actor you want variables from. Either a reference to your player BP in your widget or the other way around.
To achieve this you will have to either store the output of the “Create widget” node in a variable to access it when you want to change something or add a variable of the type of your player to your widget, set it to editable and “Expose on spawn”.
This will add another pin when creating a widget of this type where you can simply input “Reference to self”.
Once you have this reference on either side you can then from your character change the variable in your widget or from your widget get this variable from your player and display it.
I hope this helps.
Cheers