I am using a PawnSensingComponent on my character to detect enemies in front of it for locking onto them. So far I can detect them but I want to get a list of all the detected enemies in line of sight. This is what I’ve been using for now.
if (PawnSensingComp)
{
PawnSensingComp->OnSeePawn.AddDynamic(this, &ACarnievilPrototypeCharacter::LockOn);
PawnSensingComp->bOnlySensePlayers = false; // Makes non player pawns visible
}
If I’m not wrong, OnSeePawn makes it so it can do something when a pawn is seen. Is there a way to get a list of all the visible pawns at a given moment?