I have a player with many individual components that handle behavior such as jumping, blocking, attacking, bending, etc. None of the scripts knows each other. Each one listens to a specific entrance to shoot. Some behaviors share the same input depending on the state of the characters, such as ok, the ground, in the air.
I am having problems where the incorrect behavior that has shared the input will be activated (down + attack instead of down + attack is kept pressed for x seconds).
I'm looking for advice on how to handle these behaviors and have more control over what can happen when.
I have tried to solve this problem by creating a method that will disable other behaviors temporarily while the action is complete and I have changed the order of execution of the script.
I thought about adding a discrete player state and restricting what behaviors can be performed at any given time, but this increases the complexity a bit.