Need help with Target Lock On for Projectiles

Not sure where to start for this one. What I’d like is something like Bastion has for lock on targeting of the nearest enemy.

Here’s an example in action: Bastion - Gameplay HD - YouTube

Not the greatest example, but you can see how he locks on to the totems as he pulls his bow back.

Basically the target locks to a specific enemy and the player then strafes around that enemy, focusing only on them.

Here’s what I am currently using as my projectile BP:

Anybody have any info or hints on getting started on this? I tried search but came up with no results.

Thanks.

If I did not understand you wrong, I think by saying “Target Lock On” you mean you want the controlled character to keep facing the enimy when doing all kinds of actions, is that correct?

If you can find a way to get the location of the nearest enimy (say, enimy.location), then everything can be very simple using blurprint:

1.You first need to get the proper roation for your character using “Find Look at Rotation” function. The input “start” can be computed using function “GetActorRightVector” on your character, and the input “target” should be a vector computed as “enimy.location - yourcharacter.location”.

2.Then you just need to set your character facing (SectActorRotation(your character, rotator)) by applying the above rotation to your character.

Note that you may need to update these values using the tick event as they are constantly changing.

Thanks for the response Seki85, I’ll give that a try!

I attached a diagram to help illustrate what I’m trying to achieve: