Download

TActorIterator is not a template

Hi,

I’m getting the above error with the following code:


// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved.

#include "EffigyGameMode.h"
#include "EffigyHUD.h"
#include "EffigyCharacter.h"
#include "UObject/ConstructorHelpers.h"
#include "ItemVaccine.h"
#include "MarkerItemSpawnpoint.h"
#include "Runtime/Engine/Classes/Engine/World.h"

AEffigyGameMode::AEffigyGameMode() : Super()
{
    // set default pawn class to our Blueprinted character
    static ConstructorHelpers::FClassFinder<APawn> PlayerPawnClassFinder(TEXT("/Game/FirstPersonCPP/Blueprints/FirstPersonCharacter"));
    DefaultPawnClass = PlayerPawnClassFinder.Class;

    // use our custom HUD class
    HUDClass = AEffigyHUD::StaticClass();

}

void AEffigyGameMode::BeginPlay()
{
    /*FActorSpawnParameters SpawnInfo;
    GetWorld()->SpawnActor<AItemVaccine>(FVector(326.0f, 3.5f, 233.0f), FRotator(0.0f, 0.0f, 0.0f), SpawnInfo);*/

    TArray<AMarkerItemSpawnpoint*> item_spawnpoints;

    for (TActorIterator<AMarkerItemSpawnpoint> spawnpoint_iterator(GetWorld()); spawnpoint_iterator; ++spawnpoint_iterator)
    {
        item_spawnpoints.Push(*spawnpoint_iterator);
    }
}