Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const FVector CursorPawnLocation = CursorPawn->GetActorLocation();
- TArray<APawn*> GetPawnsInRange(const FVector ObservingLocation, const bool bShouldSortBySignificance) const
- {
- UWorld* World = GetWorld();
- TArray<APawn*> Results;
- for (TActorIterator<APawn> It(World, APawn::StaticClass()); It; ++It)
- {
- APawn *Pawn = *It;
- const float Distance = FVector::Distance(ObservingLocation, Pawn->GetActorLocation());
- if (Distance <= GetColliderMaxRange())
- {
- Results.Add(Pawn);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement