Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    (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:

    Code:
    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
    }

    #2
    It was literally just this:

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

    Comment

    Working...
    X