The win screen is not showing because even when the last enemy is killed it returns because ones said to be still alive. But there’s no other pawn but the player. Could anyone help me out.
for (AShooterAIController* Controller : TActorRange<AShooterAIController>(GetWorld()))
{
if (!Controller->IsDead())
{
UE_LOG(LogTemp, Warning, TEXT("fail"));
return;
}
UE_LOG(LogTemp, Warning, TEXT("killed"));
}
UE_LOG(LogTemp, Warning, TEXT("Success"));
EndGame(true);
This kills and fails every time after every enemy is killed.