Random Homing Target

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?

Please help.

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 :slight_smile:

Have a nice day!

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

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.

Well, is actually the same things but less correct :stuck_out_tongue: