When my character walks in to the actor it disappears but the the coins do not update on the HUD it just stays at 0.0.
Also if I set the coin variable to the default of 50, the coin value on the HUD still stays at 0.0.
My advice: make a function inside your MyCharacter blueprint and call it AddCoins. Then add a input to that function that tells you how many coins you want to add. So you can handle the coin logic inside of your character.
Then in your CoinActor just call the function OnOverlap. This should be a lot cleaner and should work.
The third picture is a pick up. It doesn’t really have anything to do with the problem because if I set the default coin value in the character BP to 50 it still shows as 0.0.
I have used the same method with ammo and it works fine and updates it on the HUD. The difference with the ammo is that it displays an image based on the amount of ammo left. where as with the coins I want it to show a number, not an image.
This is how I’ve implemented my ammo.
Character bp:
It pretty much says that the maximum ammo for the weapon is 10 and the minimum is 0.
The weapon can only shoot if it has more than 0 ammo which is set with the branch condition.
Each shot costs 1.
This adds 2 to the ammo amount in the character blueprint.
To show its working:
Ammo Full:
Ammo 3 shots Down:
So back to the issue…
Maybe its something I haven’t done correctly in the HUD blueprint? Because Even if I completely ignore the coin pick up and set the coin variable to 50 in the character blueprint it still doesn’t show 50 on the HUD in game.
It shows 0.0.
So its the HUD not showing the correct value from the character bp.
First check to see if your coin value is actually working by printing it to the console. If that doesn’t work, initialize the coin value using your construction script. I had a similar problem earlier and it was solved using that.
Hmm I tried what you said but even when the value get shown using the print string it still only shows up as 0.0
Here is the coin variable being set as 50 in the construction script:
Hello,
you haven’t show your interface. have you check that both coin and ammo are equivalent in their settings ? As you print in hud lmaybe var is ok hud is ok but interface have a trouble.