Engineering Coin System

It’s working 100% - GREAT! Thank you so much! I have more questions on how I want to expand on this but it will need to wait until tomorrow, it’s 4am in Berlin right now, need some sleep, then more questions. :slight_smile: You have been such a great help, seriously bro, thanks.

You’re welcome, just remember to study blueprints communication so you will have a better understanding of what you are doing.

OK, now that the coin counter / coin collection system is working as it should. I need to recreate this 2 times, once for counting/collecting Keys and another time for counting/collecting bombs. I am trying to get the key counter working now by reproducing the same system for the coins. Everything appears to be set up correctly, but the key counter text block on my HUD is not displaying the keys when picked up, can anyone spot the problem here?

ThirdPersonCharacterBP

KeyBP
7517d85d4ae4f507ab717f4d2d06817e8ee0dca5.jpeg

HUD Event Graph
Perhaps the problem is here? It wouldn’t let me create a new Event Construct, but it did allow me to copy the current one, paste it and then use that, perhaps this is wrong?
7e8058a85d6e28d58605c76b0302f25db8e939a7.jpeg

HUD TextBlock
c43b7f61264bf083a28a1fc10df95d12e1bff76f.jpeg

So as of right now, when in game and I touch a key, the sound plays, the key goes away, but it doesn’t calculate on screen.

Thanks in advance for the help!

I have seemed to figure it out on my own - setting up my HUD Event Graph like this made the Key and Coin counter both function correctly.

b36f9f9c988fd2444995d379a9f677f3b1ec8761.jpeg

You dont need to cast 2 times and put that on 2 different variables on your event graph, the first cast is already making the process.

ok, good to know - I thought I might had to cast every time I set a new variable - but after reading what you said, I changed my HUD event graph to the following and everything still works! The Coin, Key and Bomb counters are all working and properly display on my HUD and in my inventory widget.

So based on this setup, let’s say I have a blueprint item in the game and I want it to only disappear if the player overlaps it and has 30 coins, and what I want to happen when the player overlaps it is this:

IF player has 30 coins
THEN item disappears, 30 coins subtracted from the hud
ELSE item doesn’t disappear, no coins subtracted from hud

Does UE4 have a simple way built in to handle basic IF THEN ELSE statement? How would you go about doing this in your opinion?

Looking your setup you still did not understand the process of casting thing.
When you cast the blueprint and hold that on a variable, it means you can access all variables inside that, also events for example.
So if you create that variable “player data” you can access all variables inside the player simply getting player data > get bombs or get keys or get life, you dont need a variable “player data keys or bombs, etc” that first variable will already hold the information inside your player blueprint.

Concerning your coins, yes you can use the node “branch” it will compare if something is true or false.

I deleted the multiple useless variables and casts like you said and everything still works, great!

I have an item BP (BlueCandle) and when the player overlaps it, it goes away only if the player has at least 60 coins. This is what I have.

I am casting to ThirdPersonCharacter so I can get my AddScores variable where the amount of coins is stored but when I pull off from Condition nothing pops up with AddScores when I search, I have the Equal to or Greater node because the condition should be if AddScores is < or = to 60 then TRUE if not then False but I can not seem to grab any of my variables, what should I be doing here for this to be working correctly?

bump, can any professionals here help?

Does anyone here have the knowledge to help me get this working.

Many thanks in advance.