x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Delay node ignored

alt text 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?

Product Version: UE 4.13
Tags:
heliosissue.png (105.0 kB)
more ▼

asked Jan 10 '18 at 05:37 PM in Blueprint Scripting

avatar image

Ceraltes
1 1 4

avatar image Ceraltes Jan 10 '18 at 09:42 PM

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 :D

(comments are locked)
10|2000 characters needed characters left

4 answers: sort voted first

alt text

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.

Thanks guys :)

heliossolution.png (82.5 kB)
more ▼

answered Jan 11 '18 at 01:21 AM

avatar image

Ceraltes
1 1 4

(comments are locked)
10|2000 characters needed characters left

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?

more ▼

answered Jan 10 '18 at 08:17 PM

avatar image

Arceyo
138 1 5 6

(comments are locked)
10|2000 characters needed characters left

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.

more ▼

answered Jan 10 '18 at 08:32 PM

avatar image

blkhouse_vlucki
185 5 7 14

avatar image blkhouse_vlucki Jan 10 '18 at 08:34 PM

Didn't see the answer from Arceyo.

Will leave mine here just for the Timer thing :)

avatar image OFar58 Jan 10 '18 at 09:13 PM

(you could also do this with a Gate)

But Ceraltes can u maybe show where u calling the event "HeliosPrimaryRapid"

avatar image Ceraltes Jan 10 '18 at 09:17 PM

It fires once when i press left mouse button.

(comments are locked)
10|2000 characters needed characters left

Do this instead: Refire

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 :D

Cheers!

refire.jpg (72.7 kB)
more ▼

answered Jan 10 '18 at 10:01 PM

avatar image

Nofyt
401 6 7 10

avatar image Ceraltes Jan 11 '18 at 01:06 AM

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 xD thanks for the tip tho. will refrain from doing such loops again.

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question