# How to find objects in area?

**URL:** <https://forums.unrealengine.com/t/how-to-find-objects-in-area/324049>\
**Category:** C++\
**Tags:** unreal-engine, UE4, CPP, question\
**Created:** [July 4, 2015, 10:50am UTC](https://forums.unrealengine.com/t/how-to-find-objects-in-area/324049 "2015-07-04T10:50:30Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![anonymous\_user\_8e2766aa](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8e2766aa](https://forums.unrealengine.com/u/anonymous_user_8e2766aa)\
**Post date:** [July 4, 2015, 12:45pm UTC](https://forums.unrealengine.com/t/how-to-find-objects-in-area/324049/2 "2015-07-04T12:45:01Z")

</div>

Hello,

You can use Actor Iterator to find specified Actors in defined range:

```
   float MaximumDistance = 100;
    for (TObjectIterator<AActor> Itr; Itr; ++Itr)
    	{
    		float Distance = GetDistanceTo(*Itr);
    		if (Distance < MaximumDistance)
    		{
    			GEngine->AddOnScreenDebugMessage(-1, 3, FColor::Cyan, Itr->GetName());
    		}
    	}

```

If you like to learn more about Object and Actor iterators, please go here:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

Hope this helped!

Cheers!

---

_[View the full topic](https://forums.unrealengine.com/t/how-to-find-objects-in-area/324049)._
