Remove the first if. It’s useless. Just:
AShooterGameMode* GM = Cast<AShooterGameMode>(UGameplayStatics::GetGameMode(GetWorld());
if (GM) ...
Remove the first if. It’s useless. Just:
AShooterGameMode* GM = Cast<AShooterGameMode>(UGameplayStatics::GetGameMode(GetWorld());
if (GM) ...