Hi devs , i am doing a lintrace under a cursor to fill up an array with selected static meshes, and when i select different static meshes it all act like a 1 single actor , so my array always of size 1 , is tried to selec this 3 blue cubes , and as you can see from the log size never gets increased , Here is the code
void UHomingProjectilesComponent::Fire()
{
if (bIsSelecting)
{
APlayerController* PlayerController = Cast<APlayerController>(OwnerCharacter->GetController());
if (PlayerController)
{
FHitResult HitResult;
PlayerController->GetHitResultUnderCursor(ECollisionChannel::ECC_WorldStatic, true, HitResult);
if (HitResult.bBlockingHit)
{
SelectedTargets.AddUnique(HitResult.GetActor());
GEngine->AddOnScreenDebugMessage(-1, 2, FColor::Blue, FString::Printf(TEXT("HItted Elems in arr is %d"),SelectedTargets.Num()));
}
}
}
}