Change text in a widget with variables, help?

I’m have a hard time figuring out the logics of how to change text using variables in UE4.
I know this is a real newbie question, but I just need to understand the logics on how to update widget text through variables from one object to another.

I have created a widget which I have mounted to the camera, just as a test. “Text Block” text field is set as a variable in the Widget details.

But from here the logics are no longer with me.

Just a basic thing as updating the text using two different variables from the level blueprint when pressing the C key. Why would I need the Object pin in the cast for this simple task? What should I put in that Object slot?

I’m casting to the widget, and then I want to set a variable with say “1000” on FlipFlop A and “2000” on FlipFlop B, and just sending a set variable commando to the variable residing in the widget that holds the “Text Block” text, and hence updating the text.

What am I missing here, can anyone give me a direction? Thanks.

Putting the GameMode method aside for a second, just for my understanding of the variable communication in blueprints.
Take a look at this image, and specifically the nodes at the top.
I understand that the object in the left node of the Casts, should be the object that actually sits in the scene.

Just to have something to trigger the action, I’m using keyboard C. This Casts to an Actor called “PrisVariables”, which holds the variable I’m trying to make use of. I get it to output in the print.
But how do go from here to update the text field in my widget? The widget is connected to my pawn, and spawned with it.
To relate to the image attached here, I’m Casting to BP_PrisWidget, where the only simple task is to set the Textblock1Pris (which is a variable text field) with the content of the variable “Prisene”.
What I don’t understand is, what do I put into the Casting object node, the player pawn? And the variable “Prisene” doesn’t seem to get accepted by the last Set node.

For me there are so many non-logical things going on, but I just need to fetch the general idea of how this can be achieved.
Thanks again.

EDIT: Sorry, i was looking at a couple different ways to do this. You do not need the custom event on the widget…ignore the widget (just make sure your text block is there and set as a variable). (ARGH! Can’t remove the Widget image…just ignore it)

In the level BP, just grab the reference to the text block and set the text.

Very interesting input here, guys. Thanks! Things are coming along. While I see the thing about the GameMode, I need to keep it as simple as possible regarding accessibility, so that I don’t **** things up too much without the ability to solve it without exploding my head. I don’t need to use several levels in this concept.

So regarding the widget that should output the Pawn/character stored variables, it should be loaded/constructed during runtime with a blueprint, and not attached up front to the pawn, right - to be able to promote the widget to an accessible variable/reference? But it should still be attached to the pawn when it’s runtime-constructed, for easy accessibility “pawn variables” <-> “widget variables”. Have I got it right then? And last, how would I access variables in this widget from the pawn, do I still need to cast, and if so, I’ll cast with that widget variable created with blueprint in the constructor, right?

Ok peace out! :slight_smile: