Hello, wanted some help, i’m creating a multiplayer shooter game, i have a problem about the ammo, i added the ammo count in the main gun class when i get the gun is ok but when i move to another gun or drop, the weapon count resets, I wonder if there is a way to solve this, like doing it outside the character, like in the state of the player, in the game instance or the player’s controller.
This seems interesting.
I am saving ammo count in spawned weapon’s blueprint. Like in CSGO, if you drop weapon, bullets will be saved in that weapon.
Obviously you are resetting your ammo count at every Attach, Owner change or what ever.
Add breakpoint to Weapon Drop and Weapon PickUp functions of your main gun blueprint. Watch the value of your AmmoCount variable (right click to variable where you get it in blueprints, and click WatchThisValue).
You need to understand what’s the missing part of your logic.
–Blah blah blah section–
If you want a Crysis approach, you can save bullet count in PlayerState. SO when you drop a weapon, bullets will stay with your character and then if you pickup same weapon later, you will use the bullets which are in your pocket.
That’s differ the gameplay mechanics design of your choice.