How to add a shield (and a recharge station)

In this tutorial we will make a shield that can be recharged at a station.

 

1. Open BP_CharacterBase and add a new float variable (Shield, default value: 1.0)

2. Recreate this blueprint in the health section
shield_playerchar

shield_timeline

 

3. Open the W_PlayerHUD widget and add a new progress bar and create a new binding for its percentage.
shield_hudwidget

shield_hudbinding

 

4. Create a new blueprint actor, this will be the station where the shield can be recharged
shield_rechargestation
NOTE: for more info about interactive actors, check out THIS tutorial.
NOTE 2: this Recharge node is the Custom Event created in step 2

 

That’s it!

shield_example

The players health won’t be affected for as long as the shield is active.