I am having a problem with this ammo counter that I am trying to get going on my HUD with a pick-up. I made an Ammo variable In my Character BP as well as the Pick-up BP. I am pressing E to fire the grenade and then checking to see if ammo is greater than 0 to fire, if yes continue. At the end of that string I have it set ammo variable to -1. Then in my Ammo Pick-up script I am using an overlap that casts to my character BP ( but somehow still manages to be blown up by my grenades?..weird) then getting the ammo variable from my character BP and +5 to it the destroy the Pick-up. In my HUD I am Binding the text box to a function that calls upon my Ammo variable from my character. When I play this is what I get: I press E and fire one grenade, the ammo counter on the HUD goes down by 1 ( yay!!!) and then I can not shoot anymore ( yay!!!) and then I walk over to my pick_up and collision occurs ( yay!!!) the string says Hello and I added 5 to me (yay!!!) … but I get no addition to my ammo (booooo!!!) it stays at zero and the Pick-up dies. I get an error when I close the game [ Accessed None ‘My Character’ from node ReturnNode in graph ‘GetText_0’ in blueprint HUD ] now I know that this means there is some kind of communication error between the way I have the binding set up in the HUD and my BP for my pick-up, but I just don’t know how to fix it. Can you think of anything I can do to get this working?
Can you screenshot how you define MyCharacter in your HUD blueprint widget?
I have basically followed the UE4 Ammo Health and Energy tutorial for the HUD. The only Difference is that I am trying to implement a Pick-up with the script.
Can you verify the MyCharacter variable is of type BP_tmullins_character and not one of it’s parents (such as Character/Pawn/Actor)?
I am not sure how to verify that.
In the HUD blueprint you created, click on the variable “MyCharacter” in the top left panel under Variables, then check the Details panel below it and the type dropdown should be there.
Yes it is Variable type BP_tmullins_character
Oh I just noticed (by carefully looking at the HUD design, your ammo widget is an Editable Textbox, you should replace this with a regular text.
Editable textboxes are meant to be edited by the player for receiving input not as labels that get updated by the game