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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How to spawn +1 enemy every time I trigger a button

Hi everyone!

I'm new to Unreal and Blueprints and I got stuck with spawning +1 enemy every time I trigger a button.

Below you can see the blueprint script which spawns an enemy every time the ShootRespond trigger is acivated by either walking over it or shooting it. I want the amount of enemies to grow by +1 each time I trigger ShootRespond by either shooting or walking over it. So, I press the button one time it triggers one enemy. The second time it triggers two enemies, etc. I've been looking into this matter and it seems I have to create a value of sorts to store the number 1 and then make the blueprint grow that amount by +1 every trigger.

I'm not sure how to do this. Help would be greatly appreciated!

alt text

Product Version: UE 4.11
question.png (175.5 kB)
more ▼

asked May 21 '17 at 01:42 PM in Blueprint Scripting

avatar image


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

1 answer: sort voted first

Create an integer, then after each trigger increase it by one and do for loop from 1 to your variable and spawn enemy. By the way, if you call your event again while delay is counting, it would bt ignored. Be careful.

more ▼

answered May 22 '17 at 06:46 AM

avatar image

630 12 14 52

(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