Show a variable in the interface

Hi there!

Next challenge for me, so I need your help again! :slight_smile:

I successfully managed to create the collectible object. Now I am trying to create a counter that shows how many objects the player picked up on the interface.

I created in character blueprint the node tree to collect the object and a function that add 1 to an integer variable everytime one of the objects is picked and print it on screen. The printing is just for a couple of second and I have no control over how it looks, so now I would like to show that value in the interface.

I created a Widget blueprint for the interface, but I cannot understand how can I call that variable, or function I created in the character blueprint to show the value it contains. I did some experiment with an interface blueprint, but still no success.

Can some help me? Thanks in advance! :slight_smile:

I am following this tutorial 2. Displaying Health, Energy and Ammo | Unreal Engine Documentation

when I arrive at point 5 of “Script: Health, Energy and Ammo” he shows me this picture:

https://docs.unrealengine.com/latest/images/Engine/UMG/QuickStart/2/Step2_23.jpg

while I have this

&stc=1&d=1434533072

Aaaaaand once again, after 2 days of unsuccessful attempts, I ask on the forum and shortly after solve on my own.

Here is how I did it: I think it works different due to the fact that probably the version of the editor in the tutorial was different.

After setting up the nodes to pick up the objects and increase an integer variable by one in the character blueprint like this:

&stc=1&d=1434535262

I created a new bind in the widget, which created a new function. Here I created a new Variable, object reference type, with the character blueprint as a reference.

&stc=1&d=1434535275

The I did a GET for such variable, from this I got (GET) the variable picked (which is the integer variable that get increased by one each time an object is picked) and then outputted it a string.

&stc=1&d=1434535434

I hope this can help someone, so that I just not opened another thread for nothing :slight_smile: