# How can I spawn actors a certain distance away from the player?

**URL:** <https://forums.unrealengine.com/t/how-can-i-spawn-actors-a-certain-distance-away-from-the-player/489618>\
**Category:** World Creation\
**Tags:** spawn, actor, distance-fields, distance, unreal-engine, question\
**Created:** [October 7, 2021, 2:58am UTC](https://forums.unrealengine.com/t/how-can-i-spawn-actors-a-certain-distance-away-from-the-player/489618 "2021-10-07T02:58:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luke\_Music](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Luke\_Music](https://forums.unrealengine.com/u/Luke_Music)\
**Post date:** [October 7, 2021, 2:58am UTC](https://forums.unrealengine.com/t/how-can-i-spawn-actors-a-certain-distance-away-from-the-player/489618/1 "2021-10-07T02:58:46Z")

</div>

![350002-untitled.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/5/9/35950a584a78b687cab6e6c53c47bdf2d5934c44.png)

So I’m making a space game where you fly a ship around. I want to spawn meteors but only when they are just outside the players view (Which Is Limited By Fog). I have tried spawning them using “random location in bounding box” But this causes them to spawn inside the view distance. Is there a way to set up a circle like the one below, to spawn them ONLY outside it’s radius?

---

<div class="post-metadata">

**Author:** ![Luke\_Music](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Luke\_Music](https://forums.unrealengine.com/u/Luke_Music)\
**Post date:** [October 7, 2021, 3:52am UTC](https://forums.unrealengine.com/t/how-can-i-spawn-actors-a-certain-distance-away-from-the-player/489618/2 "2021-10-07T03:52:06Z")

</div>

Nevermind, I found out how to do it, for those wondering the same question…

I took the world location of the ship, and added the radius to its X axis. Next you subtracted that value from the ships X axis. Next you make a vector using that new X axis you made, and rotate the vectors yaw, by a random float between 0-360. And after all that, add that new vector to the original. This will make a circle around the ship that follows its location.

 ![350005-unknown.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/9/e/09e44f3691cb0092d92b24e8e3bcb93637b59d40.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 7, 2021, 8:31am UTC](https://forums.unrealengine.com/t/how-can-i-spawn-actors-a-certain-distance-away-from-the-player/489618/3 "2021-10-07T08:31:36Z")

</div>

![350027-screenshot-5.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/2/b/f2bbe958b361e0063458ab15290871f373a6bad6.png)

[![Image from Gyazo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/3/c/53c8a2a209c30dec76cb37361a9674aa54214e27.gif)](https://gyazo.com/66e824a3d370f191d68efc6183b14908)

Swap `Random Float` for a fixed distance, if needed.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 7, 2021, 8:40am UTC](https://forums.unrealengine.com/t/how-can-i-spawn-actors-a-certain-distance-away-from-the-player/489618/4 "2021-10-07T08:40:33Z")

</div>

Rotating a vector can be simplified to:

 ![350030-screenshot-8.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/c/9/ec9b2bf9f474ca1af4ad94b696e9d1e7f6acd71d.png)

![350029-screenshot-7.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/f/7/4f7d1ed62db36ebc09f3662876712cd60fbcd0cd.png)

There are as many ways of doing this as there are people, surely.

---

<div class="post-metadata">

**Author:** ![Luke\_Music](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Luke\_Music](https://forums.unrealengine.com/u/Luke_Music)\
**Post date:** [October 8, 2021, 7:52pm UTC](https://forums.unrealengine.com/t/how-can-i-spawn-actors-a-certain-distance-away-from-the-player/489618/5 "2021-10-08T19:52:16Z")

</div>

Thank you, this seems much more reasonable and efficient!

---

<div class="post-metadata">

**Author:** ![labeatmatoshi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@labeatmatoshi](https://forums.unrealengine.com/u/labeatmatoshi)\
**Post date:** [February 16, 2026, 11:02pm UTC](https://forums.unrealengine.com/t/how-can-i-spawn-actors-a-certain-distance-away-from-the-player/489618/6 "2026-02-16T23:02:13Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/4/6/946d5b8f68e012fd7f32cd6a355ece73958e9c1a.jpeg)
