I create a HUD widget to show the ammo count. Everything works fine (i think) but the blueprint doesn’t want to read the ammo variables from the character (the hud returns 0 instead of actual value). I complete newbie in UE4 so I used the tutorial https://docs.unrealengine.com/latest/INT/Engine/UMG/QuickStart/2/index.html . I have done everything exactly like in this tutorial but for some reason the count still don’t work.
Do you actually set your character value anywhere? Because your cast isn’t connected to anything and therefore obviously won’t do anything. So unless you set your Mycharv2 variable anywhere else, it doesn’t even hold the value to your character, and if that’s the case your GetText function tries to read the ammo value from a non-initialized character variable, which will fail and return 0.