Structure variables can't be updated?

I’ve got a Structure S_CharacterInfo, that has several variables inside of it, for this conversation, I’ll pull out Health, MaxHealth, Energy, MaxEnergy, Ammo, MaxAmmo, Armor, and MaxArmor.

In my code I Get the Structure, split the pin and I can retrieve the values I want. However, when I set the variables, everything seems fine, until something else needs to read the values from the Structure. Then the values are reverted to before I set the variables inside the Structure. It’s like Unreal isn’t actually saving the values in the Structure.

For example, I have an action, the Z key that fires my laser gun. It subtracts one Ammo point, the ProgressBar updates perfectly, then I run across an AmmoBoost Spawn, and I get +15 ammo. That’s all great, until I either shoot my laser gun, which it resets to my previous 20 ammo, or if I run across a Healing trigger. Then my Health is boosted, but my Ammo is reset to the previous 20. If I run across an AmmoBoost after the Health Spawn, my Health is reset to the initial level it was at previously.

Is there a Refresh Structure command or function I don’t know about to force my Get S_CharacterInfo structure to refresh when the variables inside are updated? I would think that just using the Set S_CharacterInfo (split structure, and piping the new value into the appropriate variable slot would be enough, but maybe I’m missing something?

Forgive the mess. I haven’t cleaned up all the pins just yet.

it looks like its because your reseting the values on the right there, ie you’re telling it to set level to 1, agility to 10 etc every time this function calls.

What you want to do is use the SetMembers function on the struct so it only set the values you want to change

I switched to using the Break S_CharacterInfo and Make S_CharacterInfo and Setting the S_CharacterInfo that way, however, I’ve still got the same problem. it seems like when the Switch is encountered (I run over an Armor instead of an Ammo Boost, the values get reset again. Would the Switch statement be causing the reset because it’s appearing before my data is being set later on?

This is REALLY messy.

make creates a new struct, you want SetMembers In Struct