Hi there, I’m having difficulty with implementing a counter for coins that are to be collected in my game. So far I have made the coin which rotates and destroys on overlap. I’ve also made it so when you “collect” the coin it prints a string to the screen, adding up the numbers each time. However, I’m looking for a counter that is fixed on the screen, looks nice and adds up each time with out disappearing like the string does.
Hey there, so far so good, you coin counter is working. But you want to stop printing it, since printing is only for debugging.
Can you show me how you setup your timer? Is this a Canvas HUD Element or is it made with Widgets?
If it is made with widgets, then just add a second Text Field with the same layout settings as you Timer has and bind the Coin Value to the Text value.
You click on “Bind” and “Create Binding” near the Text OptionField at the right side of you widget:
Ah ok, you are using the normal HUD. I would recommend you to have a look at UMG and Widgets. There are tutorials on Youtube. It’s a bit easier to setup your HUD with UMG.
If you still want to stick to the old Canvas, then you can make a function called something like “DrawCoinCounter” and place it behind the “DrawTimer” function. Inside the function you can get the CoinCounter Value like i did in the picture, but instead of pluggin it in this “returnvalue” thing (that’s a widget function) you will want to plug in the CoinCounter Value inside the “Draw Text” function. The same way you did it with the HUD Timer values.
First of all thank you for replying so quickly! Greatly appreciated I should have also mentioned that I am completely new to ue4 and blue prints etc. so bare with me If I seem a little confused.
As for the timer, here is a screen shot of the blue prints used. Maybe with these screen shots you could direct me on where to put your series of blue prints shown?
Thank you sooooo much! Got it working exactly how I wanted it!! Looks the same as my timer and counts up perfectly! Just need to work out how to make a score board now… haha