For my “for” loop, I had
for (AShooterAIController* AIController : TActorRange<AShooterAIController>(GetWorld()))
{
if (!AIController->IsDead())
{
return;
}
}
but it wasn’t working. I had to rename AIController to Controller to get it to work. I thought that the for loop was creating a variable for that loop only, and I didn’t think that it referenced the Controller in EndGame() at all.
Could anyone explain to me why/how it’s doing that? Thanks.