Download

How to find actors of type, with tag

||TArray<AActor*> foundActors;|
|TSubclassOf< AActor > classToFind = ACharacter::ThirdPersonCharacter_C;|
|for (AActor* foundActor : foundActors){|
|if (foundActor->ActorHasTag(tagName)){|
|UGameplayStatics::GetAllActorsOfClass(GetWorld(), classToFind, foundActors);||

I wonder how find a class, for example ThirdPersonCharacter_C, which is a subclass of Character. This gives an error, and I don’t understand how to include it.

for (TActorIterator<ACharacter> ActorItr(GetWorld()); ActorItr; ++ActorItr)
{
	ACharacter* CharacterActor = *ActorItr;
	if (CharacterActor)
	{
		// CharacterActor.GetName()
	}
}