Need Advice on Component Structuring (for an FPS)

To streamline the event graph you should probably create custom events for each weapon firing mechanism and feed it off / reposition it wherever else.
Usually that already cleans up the noodle mess significantly.

Another way to keep order - just in general - is local variables. within functions particularly.

Yet another way to sort or handle things is Functions.

As far as I go, since I’m sort of coding something that is a close cousin to an FPS, I have my system set up with an array and a loop so that weapons can be cycled though. Like a standard FPS going from 0 to 9. The number in the array actually matches up the same offset of the keys on the keyboard… because why would anyone want to finagle with the array if you can just make it match?
here’s a sample.


Obviously the montage to play should be changed depending on the weapon, where it comes from where it’s attached etc. This is just a basic prototype and not what the final system would end up looking like if you are already dealing with sockets (I’m not for the moment still prototyping the right animations for movement).

Anyway, back to your actual question.

You have LMB, RMB, and MWD (mouse wheel down) as possible buttons.

You can drag off from any of inputs and immediately hand off to a custom function.
The function within the character blueprint will then handle all the logic of checking what is going on and how it should respond to the button press in it’s own event graph page without much mess on the main blueprint.
It would sort of be like passing it of to the weapon blueprint - but it doesn’t have any lag or necessary checking other than adding one function to the stack… Since unreal is still OOP it obviously handles the classic stack/function call system quite well.

Hope that helps. If it’s not enough or you want a different alternative that also allows more options, you could create a custom event and move it down like explained here:
https://docs.unrealengine.com/en-US/Engine/Blueprints/UserGuide/Events/Custom/index.html

I’m not sure how you would or if you could instantiate or call the event inside the weapon to keep the code with the weapon itself without some issues on slower systems, but if you are really set on doing it here you can find out how to call the events you set up from the character blueprint (and yes, somehow you still have to call them from the character bp).

Best of luck :slight_smile: