FPS Weapon System

Godot Version

4.3

How to design FPS Weapon System

Hey everyone, I am currently working on a FPS game that features a lot of different weapons with many different behaviours (think Enter The Gungeon).

I have a finite state machine for the player, which so far only manages movement states like idle, running, jumping etc.
I need help coming up with a weapon system that

  1. Allows weapons to react to the players movement state (to play the appropriate animations)
  2. Allows for custom shooting logic for each weapon.

Should I create a second state machine for just the weapon related actions like shooting, reloading? But how to integrate it with the existing movement state machine?

I hope someone has a good suggestion, thanks in advance for tips.

i’m pretty sure what you are looking for is the AnimationTree node if you arent using it already, afaik you can even link some animations together so they play in sync with each other, i used it personally for 8-direction player movement animation but from what i’ve seen its pretty extensive in what it can do.

as for custom shooting logic if i got the idea correctly you mean like different weapon behavior like rate of fire, damage? if so i’d create a Resource that consists of all the weapon’s variables

Thanks I will look into the AnimationTree and the Resource sounds like exactly what I need. Thanks!