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"

I can't use Delay within Fuctions. Now what?

Good evening ladies and gents.

I'm making a Space Shooter for a University assignment, I'm fairly new to Unreal. I put a lot of work into planning the Design and Systems of this shooter prior to starting development as part of the University Course.

My initial Design was to have a GameController Actor that handles most systems in the game, like Score, Death, Spawning Enemies and the sort. The problem I've encountered is within the Spawning Enemies Section. Initially I wanted to have a SpawnEnemy function within the GameController that will take as input arrays of Enemies, a float as a delay between spawning the enemies and a spline (which I use for movement) to assign to each enemy on Spawn.

This is what it looks like atm.SpawnEnemy

The idea is that I have multiple Enemy Types, like Enemy A, Enemy B, Enemy C. I create an Enemy Group, like [ACBA] and I assign the groups during the Construction Script of the GameController as well as a delay, and the game controller will handle spawning each group automatically.

Problem is, that as I found out, I can't use the Delay node inside a function, so this really puts a wrench in my plans, since I need to space (hah, get it?) out the spawning of the enemies.

How would you guys go about fixing this? Is there some sort of workaround? I was pretty happy with the previous design, but It doesn't seem like it's gonna work out. So I would really like some advice from some more experienced Unreal users.

Thanks alot for taking the time to read, any help is greatly appreciated!

Product Version: UE 4.13
Tags:
more ▼

asked May 15 '17 at 12:47 PM in Blueprint Scripting

avatar image

The7thNoodle
6 2 3 5

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

1 answer: sort voted first

Use the following links to create timer and then run your function using that timer https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/UseTimers/Blueprints/

more ▼

answered May 15 '17 at 01:47 PM

avatar image

plangton
342 17 20 31

avatar image The7thNoodle May 15 '17 at 03:44 PM

The idea was to use timers to call the SpawnEnemy function each time I want to spawn an enemy group, then the function would handle spawning the whole group with intervals between each enemy.

But by not being able to use delays within the Function call, it means I'm gonna have to somewhow break down the Spawn Enemy function to single spawns with intervals within the event graph, which is not only less practical for me, but a less elegant solution as well. Which is why I'm looking for a completely different approach or a workaround.

(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