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

**URL:** <https://forums.unrealengine.com/t/i-cant-use-delay-within-fuctions-now-what/393653>\
**Category:** Blueprint\
**Tags:** design, delay, spawn-rate, unreal-engine, functions, Blueprint, question\
**Created:** [May 15, 2017, 12:47pm UTC](https://forums.unrealengine.com/t/i-cant-use-delay-within-fuctions-now-what/393653 "2017-05-15T12:47:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![The7thNoodle](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@The7thNoodle](https://forums.unrealengine.com/u/The7thNoodle)\
**Post date:** [May 15, 2017, 12:47pm UTC](https://forums.unrealengine.com/t/i-cant-use-delay-within-fuctions-now-what/393653/1 "2017-05-15T12:47:38Z")

</div>

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.

[http://puu.sh/vQFLK/c30aba7eea.png](http://puu.sh/vQFLK/c30aba7eea.png)

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!

---

<div class="post-metadata">

**Author:** ![plangton](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@plangton](https://forums.unrealengine.com/u/plangton)\
**Post date:** [May 15, 2017, 1:47pm UTC](https://forums.unrealengine.com/t/i-cant-use-delay-within-fuctions-now-what/393653/2 "2017-05-15T13:47:14Z")

</div>

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/](https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/UseTimers/Blueprints/)
