Copied from ProjectSpark.com
The following is a tutorial for making homing projectiles (projectiles that follow the target)
First, you need to make your projectile, for this tutorial we will use a simple fireball. Go to your props gallery and spawn a fireball. Now, go to it’s brain and add:
When: Duration Timer/0.2 Do:move/with flying/in direction/random vector (this will give your projectile a cool flail effect before targeting)
When: Countdown Timer/0.2 Do:
->When: Object Closer Than/10/enemies Do: move/towards/it/with flying/at speed/<wanted speed> (for spells, a good speed is around 20)
->When: not/object closer than/10/enemies Do: move/with flying/in direction/creator/camera forward/at speed/<wanted speed>
->When: Detect/Enemies Do:
->->When: Started to Do:Damage/it/<wanted damage>
Now, go to your projectile’s properties->brain-> Set template on. Then, go to sensors -> Set detect sensor on and set the field around the projectile to your wanted radius (your projectile will hit the first enemy to enter it’s field).
Now, go to your character’s brain and add:
When: <key> Do:shoot/ (using your in-world picker, pick your projectile)Fireball/at speed/20/lifetime/5/bounce on impact (not required, gives a bouncy effect)/launch frequency/<wanted frequency> (for spells, 3 would be okay, the smaller the frequency, the more shots you can fire per second)
And that’s it!