Download

(Very brief) Question on using a constant interface in GetAllActorsWithInterface

I want to find the actors which implement an intractable interface. I understand that GetAllActorsWithInterface expects an interface class reference, but specifically wants TSubclassOf<UInterface> In other words, what I’m asking is:



TArray<AActor*> InteractableActors;
UGameplayStatics::GetAllActorsWithInterface(GetWorld(), #Assuming I want to find all actors with interface IInteractable, what goes here?#, InteractableActors);
for (auto& InteractableActor : InteractableActors
{
   // Do stuff
}



It was literally just this:


 
 UGameplayStatics::GetAllActorsWithInterface(GetWorld(), UInteractable::StaticClass(), InteractableActors);