I’ve made an event that is supposed to control the rapid fire of one of my weapons.
The problem is that sometimes it ignores the [delay] node completely and fires 2 shots at once, but only on the first shot.
It seems to occur only when the delay is set to less than .5 second, but i’m not sure (i don’t have the issue on the secondary fire which is set to 1 s or so)
The “is Primary” branch controls whether i keep holding the primary fire button. Helios is the name of the gun.
In general the rapid fire seem uneven; Is there a better way to do a rapid fire weapon than a delay node?
A couple alternatives that might be a better solution would be to either use a gate node, or a looping event. Perhaps you could modify one of the approaches in the following link to suit your purposes.
How to modify the Blueprint FPS example to rapid fire?
This could have something to do with how you set things up and how the engine handles the flow of blueprints and whatnot (really, just a random guess here - could be a bug too).
Have you tried replacing this “manual loop” with a While loop? Or maybe a Timer with an interval of .2 seconds (or however much you need this delay to be)?
Maybe this would solve your problem.
Didn’t see the answer from Arceyo.
Will leave mine here just for the Timer thing
It fires once when i press left mouse button.
Ill see if i can make another solution and skip the delay altogether.
I’ve looked into the difference between delays and timers a bit and it seems delays aren’t as reliant at timers. at least on short intervals.
Ill try tackle it some more and see what i come up with, timer or loop sounds promising!
ty for assistance so far
(you could also do this with a Gate)
But Ceraltes can u maybe show where u calling the event “HeliosPrimaryRapid”
Do this instead:
Never drag a node back into the same execution chain, that will cause all sorts of issues. Simply create a custom event and call that instead at the end after the delay and it will fire every .2 seconds
well that seems to work. I guess the manual loop might have caused the issue in the first place but i made another solution and didn’t see this til i was finished
thanks for the tip tho. will refrain from doing such loops again.
I made a timer based solution.
the Helios Primary Rapid 1 is called after weapon check and key press check to keep from firing primary and secondary fires at ones.
Once in the function it sets of the timer for rapid fire, but the timer counts down before execution so i had to ad one standalone shot to make the gun go off the instance i press.
The “is Ready?” bool is used in the shoot delay which basically just sets a bool off then wait then on again; an event i made to be used for any gun needing it to prevent spamming clicking
The break for the timer is called from release LMB
not the most elegant solution but it does what its supposed to at least.