You’re setting the value properly, but I’m guessing that the return from your Fire function is the problem. Can you send a screenshot of the function blueprint?
Below you’ll see three pictures. The first one of a “weapon base” actor, and the second and smg45 actor, that is parented to the weapon base. I have the ammo variables for the smg in the base, but am trying to set their values inside the smg blueprint (decrement every shot). Thing is, it works for a second then reverts back to its default when I print it from the weapon base…which is strange (3rd picture).
What am I doing wrong here? This is preventing me from updating the text for the ammo on my UMG. I am still a beginner, and although my comprehension of all of this has gotten better, I’m still trying to fully grasp the concepts around inheritance. Any good tutorials are also welcomed. Thank you in advance for your time
Edit: I want to elaborate on something about the 3rd picture. That is the output text from the weapon base, it is showing the variable go from default to the correct value as i shoot, but it DOESNT just start outputting the default value if I stop firing, if i fire down to zero and stop firing, it will constantly cycle between 25 and 0 until i exit the preview. That tells me its not just resetting back to default, and may be relevant.
I will do both, just a moment please
Ah you were right, something in my character bp was causing a duplicate weapon base. Thank you!
No problem!
Also check that you don’t have two weapon base objects in your level. That would create a similar output.