Get the target?

I’ve been stuck on this all day and I’ve almost had enough. All I’m trying to do is change my text to match my ammo.

Unreal has a serious problem of not being nice when you want to get stuff outside of the blueprint, which I’m learning is really annoying. I have messed around with casting, settings, etc. all day trying to do this with no avail.

All I need is the Target:
102990-
I have no idea how to reference it though! The function is called on my Widgit, it looks like this:

102991-variable.png

I have tried a variety of casting methods but they all need an “Object” or something and go on an infinite loop of me attempting to reference my Widgit.

Please for the love of peace tell me how I can get the target and go about with (what’s left) of my day.

First click on your text field in UMG. In the details panel go to the Content section. You will see a text field with a button next to it that says Bind. Click on that and select New Binding. What this does is bind the text to a function. Any time something in the bound function updates, the text updates as well (this is not actually what happens, but you can think of it that way).

This will create a new getter method. You should rename it to something more descriptive.

103008-step2.png

From here you will want to find where you ammo is stored and get the value. It will be an int I assume, but you will cast it to an FText. The image below shows you how to get started.

So I am back linking to your previous post as it should solve your issue and other people might find the back link useful.

https://answers.unrealengine.com/questions/470111/using-a-variable-on-two-blueprints.html