State machines & Weapon logic

Hey! So I have a character blueprint with some hand to hand combat happening. I want to add weapons, so I’ve created a state machine for gun and sword movement. I’m using functions to call the state machine in my character’s blueprint, currently just with a button press.
The question I have is: in my character blueprint where do I put the gun or sword’s functionality code, after being called by the state machine?
Currently the hand to hand combat activates regardless of the state, and I understand you’d likely use booleans as conditions with true or false.
I’d like to know the best way of keeping all the code separated in the blueprint (hand/gun/sword) yet all be called from the same character blueprint, and hopefully in a way I won’t have to go through all the hand to hand combat already and do it in a different way. Would the combat logic call on the state machine, or the state machine is called first then code after it? Like placed where the print string is in the photo?
I appreciate any tips or advice and comments on best practice when doing something like this.
Thank you.

depends on your game, if you only want a few weapons could likely just keep it in the character but if you want a more modular approach use an actor/actor component for the weapons and they can handle their own logic.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.