What’s even weirder is the blueprint version returns fine?
Its on a subsystem that I made if that makes a difference but that should even matter because Im still grabbing some of the actors.
I set it up as I should too: an array of actors above the call labeled actors and I make the output array from the function said array
After the initial function call I iterate using a simple foreach and I debug the editor label for each actor in the array and I get a result that looks similar to
Actor3
Actor3
Actor1
Its literally skipping one of my 3 actors in the scene and duplicating an actor already in the array and its frustrating because this should work without issue, how did they ruin such a simple function?
Same thing happens with actors of class too
EDIT Code:
TArray<AActor*> speakers;
UGameplayStatics::GetAllActorsWithTag(GetWorld(), "Speaker", speakers);
for (AActor* speaker : speakers)
{
GEngine->AddOnScreenDebugMessage(INDEX_NONE, 5, FColor::Green, speaker->GetActorLabel());
}
EDIT #2 : so the problem gets weirder with the more actors you add, It seems like its skipping every other actor and duplicating the last actor in the array enough times to fill in the gaps
for example this is what happens when you have 5 actors
Actor5
Actor5
Actor5
Actor3
Actor 1
Such a bizarre bug