HUD Not displaying correct value?!

Hey, so I have been trying to make a score HUD that displays the Round you are on and the amount of kills you have had however it seems to just be giving me 0.

I have two variables in a blueprint called “zombiesAlive” and “zombiesforRound”.

zombiesAlive - How many zombies are alive at the current time, is -1 when you kill one in blueprint BP_Enemy (Refrence from BP_Enemy to spawnVolume.

zombiesforRound - How many zombies should be spawned per round (roundNumber * 10 (Round 1 * 10 = 10, so spawn 10 zombies).

So, I tried to make my widget display the value’s of these integers/variable’s however that does not work out. It just says the round number and amount of kills = 0.

There are no error’s however.
In the image below you can see the spawnVolume blueprint reference.

Any help is appreciated.

Is your Spawn Blueprint 2 reference being set somewhere in this bp?
If not that could be the reason for returning a 0 value. Otherwise there might be a hick up in this Spawn bp, the value is not being altered correctly.
I was wondering, if this is a widget bp and you’ve made the Spawn bp reference editable, how are you selecting the bp in question in the editor?

Hope it helped :slight_smile:
good luck

Hi, so the PrintString is displayed correctly?
If the binding function gets called, and the PrintString shows the correct value, did you check the size of the Textbox if the first digit might be cut off?
If the PrintString does not get called at all then the binding might be broken somehow. Perhaps it helps if you remove the binding and the function and bind it again.
I had the same issue as far as i remember. After some renamings I guess. I think rebinding solved it.

No, Print string is being ran however it is spamming “0” when it should be 1.
As soon as the level starts, it spawns 10 ai’s and then sets it to round 1.

The round number, ai counter and other variables work fully in the blueprint they are in. (SpawnVolume Blueprint).

So it is being executed, however it is not getting the correct variable value in this widget.

So yes the image you see is a widget event graph binding.
This image:
Is the spawnVolume blueprint I am trying to reference.

Then it get’s the two variables from that blueprint but says they are 0 in this widget.

It is not being “Set” in the widget, I am unaware how to do so when it comes to setting a blueprint within a widget?

However, where I create the widget (in BP_Soldier), it added a “Spawn Blueprint 2” input. So I referenced spawnVolume in “BP_Soldier” and added it to the input.

However it still does not seem to be working. :confused:
All a bit confusing but hopefully that makes sense.

You need to ensure that everything is valid before being concerned about the variable, it seems you’re just assuming the way you’ve added it worked.

Add an IsValid node to make sure that SpawnBlueprint2 is valid, and if it is then print it’s object name.

Print your variables on tick from inside your SpawnBlueprint2 to make sure they aren’t actually 0.