Make flying Projectile flying in a curve?

Hello.heroes,great people.
I have a bullet that flys to target and go through the target then go back again,it moves in a straight line,which is not I want.
here’s video and BP


here’s a picture indicating what I want from top down 2D view.

I don’t have much idea of doing it.
please give me a hint,suggestion,or exact blueprint is best.
I would truelly appreciated.

To me it sounds as if you wanted a homing PMC with orient to movement Rotation Follows Velocity, no?

How’s this:

  • orange => track player
  • green => temporary ignore player after a hit

Close enough?

1 Like

Thanks for responding.it maybe?What is homing PMC…?I heard this several times but I don’t really know what it is.is it easy to do?

Projectile Movement Component - you’re already using it. It can automagically home onto targets.

The projectile:

  • we need to provide a component the projectile will try to hit
  • the mesh has no collision
  • the actor’s root collider overlaps all and does not simulate physics
  • when the projectile hits, we nullify the PMC’s Homing Target Component, and restore it after 2s

The player fires them:

1 Like

Thanks,I just copied your code.I found it really hard to hit the player.


The effect is not very good…

maybe I should spend some time play with those values.

1 Like

It’s somewhat physically correct and it needs to be tweaked if it’s supposed to perform differently, ofc. Increase the homing magnitude. You could also interpolate the homing magnitude by sampling distance to target. The closer we are, the higher it goes. This would give you shallow looping angles and distance and tighter loops close to target.


If that’s not enough, you’d need to make your own custom movement component that does the required math. Predict player’s lead and interpolate the projectile to that target.

1 Like

I just discovered that the homing magnitude is not a turning speed.It’s something like turning speed and flying speed combine together…lower value causes not only it can’t turn direction,but also flying slower.
That case I don’t know how to adjust it…

As mentioned above, sample the distance to the target. The closer we are, the higher the value. If you’re not sure how to do that, then writing a custom component may not be a good idea, not yet.

Another addition to the default homing PMC way is to create an extra component on the player that simulates lead - it moves ahead of the player, as dictated by their velocity. The projectile should try to home on that instead of the player capsule.

The idea is to accelerate towards where the player will be, not where they are atm.

1 Like

I tried this,that’s how I discovered that the magnitude value is not only direction turning speed.I was expecting the lower the value,it draws a larger arc.but it didn’t draw the arc .it slow down the velocity if the value is lower.
if the distance is faraway from target,the value is lower.it ended up move at a very low speed.
So I figured it’s hard to adjust since it’s not a turning speed as I expected.but it’s interesting,I would pay more time to play with it.

This inspired me.honestly it’s a talented idea to me.
I didn’t use homing,I still directly set the velocity to chase target.
And I didn’t put a extra component on player.but I spawned a new rotating actor at the projectile location after it hit the player.and then temporarily have the projectile to chase the new actor for a moment then back to chase player so that it looks like moves in a arc.
the “lead actor”be like

Result:

Thank you very much for your help !btw my English is not good,i apologize if you see anything strange…

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.