# Random Homing Target

**URL:** <https://forums.unrealengine.com/t/random-homing-target/413717>\
**Category:** World Creation\
**Tags:** random, homing, unreal-engine, projectile, question, Blueprint\
**Created:** [January 4, 2018, 8:25am UTC](https://forums.unrealengine.com/t/random-homing-target/413717 "2018-01-04T08:25:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grey27](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Grey27](https://forums.unrealengine.com/u/Grey27)\
**Post date:** [January 4, 2018, 8:25am UTC](https://forums.unrealengine.com/t/random-homing-target/413717/1 "2018-01-04T08:25:34Z")

</div>

Hello, I have a projectile which I have set to home in on a specific target. However, I wanted it to randomly home in on 1 out of 3 targets every time it spawns.

I tried scripting it ( Will attach screenshot of my script ), and it kind of worked. Only issue is, when I run the game through my randomization script, It spawns my projectile standing still for the first 3 spawns before it starts randomly homing.

The projectile spawns and homes in on the target perfectly when I dont pass it through the randomization script. Is the problem from my randomization script?

 ![225888-2018-01-04.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/1/3/e130a57a4da3b6ceb6ebb98a85e1d66869768932.png)

Please help.

---

<div class="post-metadata">

**Author:** ![Iohoilpotere](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Iohoilpotere](https://forums.unrealengine.com/u/Iohoilpotere)\
**Post date:** [January 4, 2018, 10:04am UTC](https://forums.unrealengine.com/t/random-homing-target/413717/2 "2018-01-04T10:04:06Z")

</div>

Hi! I’m not totally sure I’ve understand the issue, so correct me If I’m wrong.

With the randomization script the projectile spawn, it smile at you trolling for 3 seconds and then he decide to reach its target.

If I guessed the problem is because the “Set timer by event” node don’t start the event istantly, he wait for the time you set up. You can make it start istantly calling the event right after the timer (easly, call the “TargetLoop” event just after the Set timer by event node).

If I was wrong explain me the prolem in order I can help you 🙂

Have a nice day!

---

<div class="post-metadata">

**Author:** ![Grey27](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Grey27](https://forums.unrealengine.com/u/Grey27)\
**Post date:** [January 4, 2018, 5:05pm UTC](https://forums.unrealengine.com/t/random-homing-target/413717/3 "2018-01-04T17:05:57Z")

</div>

Hello, sorry I had left for work. Will give what you said a try and get back to you.

---

<div class="post-metadata">

**Author:** ![Grey27](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Grey27](https://forums.unrealengine.com/u/Grey27)\
**Post date:** [January 4, 2018, 5:32pm UTC](https://forums.unrealengine.com/t/random-homing-target/413717/4 "2018-01-04T17:32:53Z")

</div>

Hello, I figured out what I did wrong, connected the wrong nodes. Should have connected the Event by timer to the switch instead of the Target Loop event. Thanks though.

---

<div class="post-metadata">

**Author:** ![Iohoilpotere](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Iohoilpotere](https://forums.unrealengine.com/u/Iohoilpotere)\
**Post date:** [January 4, 2018, 5:55pm UTC](https://forums.unrealengine.com/t/random-homing-target/413717/5 "2018-01-04T17:55:28Z")

</div>

Well, is actually the same things but less correct 😛
