How to implement a money pickup

In this tutorial we will add a money pickup and have it display the current amount on each players individual HUD how much they have.

 

1. Add a new int variable to BP_CharacterBase and two new functions AddMoney and RemoveMoney. Both functions have one input variable (int).

tss_money_addfunction

tss_money_remove

 

2. Duplicate the health pickup and change its blueprint to add money instead of health.

tss_money_duplicatehealth

tss_money_pickup

 

3. Open the W_PlayerHUD widget and add a text to it, make sure to set it as a variable in the upper right corner.

tss_money_hud

 

4. Open BP_PlayerController and inside the UpdateHUD function recreate the following at the very end.

tss_money_controller

 

5. Open W_OtherPlayersInfo and add a text there, but for this one use the create new binding function.

tss_money_hud_other

tss_money_hud_other_bp

 

That’s it!

You now have 2 new functions that you can use, to test them out do something like this.

tss_money_test

tss_money_test_ingame