Homing Projectile In Unreal Blueprint or Niagara

I have been trying out different ways to achieve a homing projectile that I can use to simulate gameplay when creating effects. I have had 0 success. Ive tried Move to actor / location in blueprints, but I don’t know how to use Ai Controllers. I have tried splines but I can’t seem to get the end points to lock onto the actor. That’s what came to mind when I was working on it. I have seen some point attraction force use but I don’t know how viable that is in a development environment.

any help would be much appreciated.

Heyo, hopefully this pseudo BP code can help.

Keep in mind this is just for demonstration.
The idea is you’ll lerp between your current projectile position until you reach the target.
Change the interp speed to modify the projectile’s speed. Don’t forget to toggle the sweep checkbox on the set actor location function.

If your target is moving you’ll obviously need to check on tick the new position and update the target position.

I only have a sphere collision as the root component and my niagara system in there.

(So nothing fancy going on)

I will try this when I get home and update you with the progress. Thanks for helping!

So, I’ve managed to get something working with what you gave me. I made a single edit to get it to work if the target was moving. Displayed below.

I have been unable to trigger the event on hit though, It doesn’t destroy the actor. I want to destroy the missile when it hits so I can play an animation at the target when it does occur.

Hello!
Hit even needs to be from your collision component not from your “receiver” or target. That will probably be enough to fix it.
I recommend reading a bit about collisions in unreal: Collision Overview | Unreal Engine 4.27 Documentation

1 Like