# PCG distance comparison for filtering

**URL:** <https://forums.unrealengine.com/t/pcg-distance-comparison-for-filtering/2647197>\
**Category:** World Creation\
**Tags:** unreal-engine, question\
**Created:** [August 19, 2025, 5:20pm UTC](https://forums.unrealengine.com/t/pcg-distance-comparison-for-filtering/2647197 "2025-08-19T17:20:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elryk1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Elryk1](https://forums.unrealengine.com/u/Elryk1)\
**Post date:** [August 19, 2025, 5:20pm UTC](https://forums.unrealengine.com/t/pcg-distance-comparison-for-filtering/2647197/1 "2025-08-19T17:20:26Z")

</div>

In PCG, is there a way to compare the distances of points from a common location and remove points based on that distance if they are similar?

I am trying to generate points for a solar system and want to avoid having multiple planets on the same “orbit path”. I’m looking for a way to tell PCG that if there are multiple points within a range of distances from a given location (the sun), filter out all but one.

I’m also open to suggestions if someone already has a good method for generating points to spawn planets around a sun.

---

<div class="post-metadata">

**Author:** ![SloaneFragment](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sloanefragment/32/975422_2.png) [@SloaneFragment](https://forums.unrealengine.com/u/SloaneFragment)\
**Post date:** [August 20, 2025, 12:03pm UTC](https://forums.unrealengine.com/t/pcg-distance-comparison-for-filtering/2647197/2 "2025-08-20T12:03:38Z")

</div>

this might help.

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/3/a/e3a9afe0bfb7b3d286898e85b3ab584922e0f599.jpeg "Unreal Engine 5 Tutorial - PCG - 15. Distance") ](https://www.youtube.com/watch?v=8MWaqS-GyCQ)

---

<div class="post-metadata">

**Author:** ![Elryk1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Elryk1](https://forums.unrealengine.com/u/Elryk1)\
**Post date:** [August 20, 2025, 1:38pm UTC](https://forums.unrealengine.com/t/pcg-distance-comparison-for-filtering/2647197/3 "2025-08-20T13:38:33Z")

</div>

I was already aware of this and seen this video before while looking into this. I re-watched it just now in case I missed something, but it seems I did not miss anything. This is somewhat helpful, as it provides the first part of what I need (getting the distances), however, I am stuck on how to compare those distances to filter out similar distances.

As an example:

Lets say PCG gives a point that is 500 away from 0,0,0 as well as other points that are close to that distance (but maybe not in the same area) from 0,0,0. I am looking for a way to filter out all other points that are between 450 and 550 from 0,0,0. This way, there is only 1 point with a distance between 450 and 550 from 0,0,0.

EDIT: Here is an example of the problem I am trying to fix:

 ![Distance](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/a/2/7a26294609fd7383852fbb6860c906be8a08ce41.png)

Notice that points 0 and 6 have very close distances, even though their positions are quite different. One of those should be filtered out.
