I added 2 text boxes in the corner of the CharacterHUD and named them ‘Ammo’ and ‘MaxAmmo’
Then created Bindings for them here
Edit the bindings
to look like this
Set up the key binding ‘R’ for reload in Project Settings
Make 3 new variables in FPS_Character (set the default values after compiling (I used Ammo 25, MaxAmmo 100, ClipSize 25))
Make a new function called reload and edit it to look like this
Modify your Fire weapon loop so it -1 bullet each shot and no fire with 0 Ammo
Then add a ‘Reload’ action event to call the ‘Reload’ function
The only problem is after 0 bullets gun stops working (obviously) but ammo count still goes down on click, I’ll try and fix that now.
Edit: Fixed it by adding a set ammo node after this branch
That was fun (I’ll watch the video now and see how the teacher did his)
Edit 2: Had to modify the next step as well to work with this (commented there)