# Find closest safe place to put an actor with physics enabled

**URL:** <https://forums.unrealengine.com/t/find-closest-safe-place-to-put-an-actor-with-physics-enabled/269583>\
**Category:** World Creation\
**Tags:** unreal-engine, Physics, UE4-27, question\
**Created:** [January 1, 2022, 8:06pm UTC](https://forums.unrealengine.com/t/find-closest-safe-place-to-put-an-actor-with-physics-enabled/269583 "2022-01-01T20:06:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lehks](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lehks](https://forums.unrealengine.com/u/Lehks)\
**Post date:** [January 1, 2022, 8:06pm UTC](https://forums.unrealengine.com/t/find-closest-safe-place-to-put-an-actor-with-physics-enabled/269583/1 "2022-01-01T20:06:12Z")

</div>

I want to set an actor’s location (which is obviously perfectly doable using SetActorLocation()). The problem is, that this actor has physics simulation enabled (or rather its root component, which is a static mesh). This means, that if I set the location to somewhere, where another actor has already been placed, then they are overlapping which results in one of them being exploded away.

Is there a way to find a “free” spot that is close to my intended location (in a similar way to SpawnActor(), which allows the adjustment of the location when spawning the new actor)?

---

<div class="post-metadata">

**Author:** ![something45](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@something45](https://forums.unrealengine.com/u/something45)\
**Post date:** [January 1, 2022, 8:56pm UTC](https://forums.unrealengine.com/t/find-closest-safe-place-to-put-an-actor-with-physics-enabled/269583/2 "2022-01-01T20:56:02Z")

</div>

Maybe you could build on what’s been discussed in this thread.

> [@How to play Death Animation whenever the enemies Health is 0? (In Blueprints or C++ and spawn again with the AI Controller)](https://forums.unrealengine.com/t/how-to-play-death-animation-whenever-the-enemies-health-is-0-in-blueprints-or-c-and-spawn-again-with-the-ai-controller/267910/41):
>
> Good progress. The spawn position should probably be determined by the spawner itself or set to specific areas. Basically, before you allow the spawn you check the capsule size with a sweep and test if the object can indeed be spawned where you want it to. If it can you proceed, if it cannot, you find another spot. Further development of that would obviously tie into either nav mesh or nav invokers. However it’s likely overkill for your needs. Keep it simple. Have some components into the l…
