Character index and Lock on problems

Hello. I am trying to create a better lock on system for my game. Right now I can lock on to a single enemy within the level using Get all actors of class and casting to the enemy BP in the lvl then setting visibility.

I also have a script to deal with the camera swinging in ect.

This all works great if i only want to target one enemy. Problem is I have 2 enemies in my level that i want to be able to lock on to.

I created an array and stored both my enemies, did for each loop, however i still only ever target the enemy that my object lock is cast to as i use the capsule componant to target.

So here is my question.

Is it possible to create a character BP that has more than one character in it?

Ultimatly I want to be able to just Cast to an ENEMYMOB blueprint and set my lock on object from there.

Ive tried to create an array BP with both chars in it but if i cast to it Nothing happens.

Perhaps I am going about this all the wrong way?

Can anyone help me out?

Many thanks

Try using a line trace from your character to a further position ahead of where the character faces. You can easily do this by having an empty box or sphere in your character component to use as a target location. Once that is set up, use the hit result from the trace to determine the enemy to lock on. You can also set it to ignore all other actors. Casting is useful to access the bluebrint functions of actors, not really to find enemies in game space.

Cheers, that is working better than expected, I used a sphere trace for objects in the end and set all my enemies as cars lol. Attatched BP for anyone else who may want a look.