I’m trying to set up a weapon system where the left mouse button fires the weapon for single, semi, and automatic fire depending on which weapon is equipped. I actually have a system that works but I’d like to make it more efficient if I could. Currently, when the left mouse button is pressed it calls a custom function that selects the firing mode based on an enum associated with the weapon. The single and semi fire work fine this way, but the automatic works by using a timer on a loop that turns off when the button is released. This works, but is there a better way of using the Enhanced Input system for this to get rid of the timer? I’ve tried changing the mouse button to Hold and Release and changing the pin to Ongoing and rid of the timer but then it causes the semi, and single shot to repeatedly fire. Any help would be appreciated. This is what my input looks like:
If it works it’s good but if you intended to expand the system then there are 2 good options.
Move the logic to the item/weapon itself. This scales better if say you next add melee weapons, combos, items like potions etc.
Really advanced, move the logic to its own class. Basically similar to GAS where each class is an ability
