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
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.
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.
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