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"

Mouse left button down to shoot automatically


How can I shoot automatically when I hold the mouse left button down and stop again when I released it. There is only Pressed and Released in the mouse event.

in blueprint... Thx

Product Version: Not Selected
more ▼

asked Apr 17 '14 at 10:58 PM in Blueprint Scripting

avatar image

3 1 2 2

avatar image WeezY Apr 17 '14 at 11:57 PM

I can't get it to work... :-( Can you see what is wrong.


fireauto.png (70.4 kB)
avatar image Shadowriver Apr 18 '14 at 01:41 AM

I updated my anwser with image :)

avatar image Shadowriver Apr 18 '14 at 12:07 AM

Ah do you can open and close with action, sorry i didn't know about it. remove the boolean (it's actully not needed), make a "Branch", to input of it plug "Pressed", first output of it plug to "Open" and Secound on "Enter". Now Delay, plug "Exit" of gate to input of "Delay" and "Completed", make another Branch, first plug to you fire mechanics and 2nd output plug to "Enter" of gate. "Released" plug to "Close" ofcorse

avatar image Loop De Loop Apr 20 '17 at 06:51 PM

Since this question has already be answered, this site has also become extremely useful to me! Hope it helps! (: [1]: http://www.breadfish.co.uk/

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

Make a loop with delay which time will be time between shoot and Boolean which say "IsFireing" and create gate note which will block the loop when "IsFireing" is false. Now on key press start the loop and set "IsFireing" to true, and on release set "IsFireing" to false.

more ▼

answered Apr 17 '14 at 11:07 PM

avatar image

37.2k 936 172 1116

avatar image Shadowriver Apr 18 '14 at 01:40 AM

alt text

Ok here you go, this is my solution :) Insted of Fire Impulse use your fire block

blueprint.png (63.0 kB)
avatar image WeezY Apr 18 '14 at 12:15 PM

thanks to both of you... :-)

avatar image Gunnar0 May 28 '15 at 11:41 PM

Thank you so much!i!i!i!i!

I recommend you accept this answer to resolve it. (Check mark under vote)

avatar image DanielGravient Jun 02 '17 at 11:17 AM

That helped so much. I tweaked it a little bit to use the values of a curve as delay time. I added two vars for it, the curve itself and a time count float.

I use this variation for an add item menu button, to add items with a button pressed variating the ratio.

alt text

captura.png (138.5 kB)
avatar image Nix Jul 10 '17 at 09:37 PM

I don't think this is a good implementation, since with this approach you can just quickly click fire button and fire faster than your delay.

avatar image Kaz71 Sep 23 '17 at 03:27 AM

If the auto-fire function is just a convenience, the above solution should work. If you want to have a hard limit on fire rate, you can uses this, which I based on the above solution.

Auto-fire bluepriint

autofire.png (156.7 kB)
avatar image clydhi Oct 26 '17 at 01:50 PM

Thank you, it works perfectly.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I'd set a variable on the Blueprint that holds the fire position with Pressed and Release, then using the Tick Event (called for updating in the scene), test that variable with a Branch, then hook that up to your fire logic.

alt text

firechecker.png (88.2 kB)
more ▼

answered Apr 18 '14 at 12:35 AM

avatar image

321 8 7 15

avatar image Shadowriver Apr 18 '14 at 01:14 AM

There one flaw in this thru, Tick is called in every frame, so fire rate be depended of frames per second... in other words people with better GPU will have gameplay advantage :p.

Deata Secounds is outputing time between frames specially for youto scale varable changes and make code time dependent. Thats why i proposed delay format, internationally SetTimer could be used which which can be set to intervalmode

avatar image WeezY Apr 18 '14 at 01:19 AM

Yes it's correct. CMD: STAT FPS show that... :-) but it works. Maybe I will fix it someday...

avatar image iveytron Apr 18 '14 at 02:29 AM

Yeah, that is a consideration, depending on implementation of how the weapon fires (fire rate could be set in the Fire function, etc.).

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I couldn't get the above to work as intended but i found a solution using parts of other answers

more ▼

answered Nov 06 '17 at 12:29 AM

avatar image


(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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