Weapon not firing after emptying clip and picking up more ammo

Ok so this will be a hard one im not gonna lie, but any help at all would be appreciated because I have been stumped for days on this.

So the issue im running into is that when I empty a weapon of all its ammo, (setting its ammo integer to zero) I cannot shoot again until I swap weapon slots, after which I have no trouble firing and everything works as it should.

Blueprints below. Inventory system works by setting an array variable to correlate with with an index to swap between the two weapon slots. If you need/want full inventory blueprints Id be happy to show them.

Again, any help at all would be greatly appreciated, thank you in advance.







lots going on here so ill give you a few tips.

  1. make sure the ammo pickup is handled on server
  2. I’d recommend a timer over the Gate/Tick logic on the weapon.
  3. you’re not handling the CanShoot false branch? should probably close Gate/Cancel timer?
  4. for readability i’d probably separate the authority path ie. Server shoots, client just plays FX?
  5. your weapon checks are only checking PlayerCharacter(0), since this is probably run on server it will always be the server character.
1 Like

Sorry just want to clarify what you mean in 5. when you refer to playercharacter(0)? How do I fix this. Sorry for my ignorance, first multiplayer game for me.

so the key to multiplayer is everything should basically run on server, especially something like CheckAmmo (you can still have local prediction) so when you query GetPlayerCharacter(0) you’re asking who is the first character, and since you’re asking on server it should (but not always) return the server player. this means if player 2 trys to check his ammo hes checking against player 1

you need to pass in a reference to the weapons ‘Owner’ ie playercharacter.
you can do this when you spawn|equip|fire the weapon for example

How would I define the weapons owner? Ive looked into this a little and cant see to find anything that applies well enough to me for me to use it.

you already have the Fire interface, you could add an input for the owner.

a better place however would just be when you equip the weapon

Do not use Single Player nodes in multiplayer.