I think components might be an option though just looking over your current code I think the initial problem is you’re trying to call destroy on the TArray multiple times instead of the contents of the array below I think is more accurate? Also should it be an “AActor” class not just “Actor” though i’d guess that should error if you typed it wrong?
I’m a bit of a newbie so i might just not understand a feature of C++\unreal if what you had should have worked…
void APatrolPath::BeginDestroy()
{
TArray<Actor*> temp;
GetAttachedActors(temp);
// auto iterate though all the actors you already have in the TArray
for (Actor* CActor : temp)
{
CActor->Destroy();
}
Super::BeginDestroy();
}