# How to get a random point in a hollow circle

**URL:** <https://forums.unrealengine.com/t/how-to-get-a-random-point-in-a-hollow-circle/453829>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [August 14, 2019, 6:16am UTC](https://forums.unrealengine.com/t/how-to-get-a-random-point-in-a-hollow-circle/453829 "2019-08-14T06:16:43Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![xermao](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@xermao](https://forums.unrealengine.com/u/xermao)\
**Post date:** [August 14, 2019, 6:16am UTC](https://forums.unrealengine.com/t/how-to-get-a-random-point-in-a-hollow-circle/453829/1 "2019-08-14T06:16:43Z")

</div>

![284999-tim图片20190814141515.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/c/b/1cb799267605f76199b0966e9985e358aa39551b.png)

Like in this image,player is the red point,and I want to get random point in black area.

---

<div class="post-metadata">

**Author:** ![IndieGameCove](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IndieGameCove](https://forums.unrealengine.com/u/IndieGameCove)\
**Post date:** [August 14, 2019, 6:53am UTC](https://forums.unrealengine.com/t/how-to-get-a-random-point-in-a-hollow-circle/453829/2 "2019-08-14T06:53:19Z")

</div>

Idk about c++, but with blueprints you would take the random unit vector node and multiply the by the radius of your circle. Could use the random float in range node for the radius to control the width of the circle.

---

<div class="post-metadata">

**Author:** ![xermao](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@xermao](https://forums.unrealengine.com/u/xermao)\
**Post date:** [August 14, 2019, 7:54am UTC](https://forums.unrealengine.com/t/how-to-get-a-random-point-in-a-hollow-circle/453829/3 "2019-08-14T07:54:37Z")

</div>

Can you post a picture about the blueprint you talk?I’m not familiar with blueprint

---

<div class="post-metadata">

**Author:** ![Firefly74](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Firefly74](https://forums.unrealengine.com/u/Firefly74)\
**Post date:** [August 14, 2019, 10:24am UTC](https://forums.unrealengine.com/t/how-to-get-a-random-point-in-a-hollow-circle/453829/4 "2019-08-14T10:24:28Z")

</div>

Here the c++ version:

```
3D : 
auto result = FMath::VRand(); 
result *= FMath::RandRange(BlackAreaInnerRadius,BlackAreaOuterRaduis);

2D : 
auto result = FVector2D(FMath::VRand()); 
result.Normalize();
result *= FMath::RandRange(BlackAreaInnerRadius,BlackAreaOuterRaduis);

```

you would need to add the player location to the result obviously

---

<div class="post-metadata">

**Author:** ![JonnyDotNet](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JonnyDotNet](https://forums.unrealengine.com/u/JonnyDotNet)\
**Post date:** [July 17, 2020, 4:33pm UTC](https://forums.unrealengine.com/t/how-to-get-a-random-point-in-a-hollow-circle/453829/5 "2020-07-17T16:33:33Z")

</div>

Here is a possible Blueprint solution:

 ![307440-annotation-2020-07-17-173031png.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/e/6/ee6ce92d44d7d4b57a54187fe0683b0844de7c81.jpeg)

---

<div class="post-metadata">

**Author:** ![Zodi\_X](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zodi\_X](https://forums.unrealengine.com/u/Zodi_X)\
**Post date:** [July 24, 2022, 8:55am UTC](https://forums.unrealengine.com/t/how-to-get-a-random-point-in-a-hollow-circle/453829/6 "2022-07-24T08:55:21Z")

</div>

For some reason it always gives a random location even if i dont attach "random float in range

---

<div class="post-metadata">

**Author:** ![Zodi\_X](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zodi\_X](https://forums.unrealengine.com/u/Zodi_X)\
**Post date:** [July 25, 2022, 12:32pm UTC](https://forums.unrealengine.com/t/how-to-get-a-random-point-in-a-hollow-circle/453829/7 "2022-07-25T12:32:35Z")

</div>

I made a whole tutorial just for you:  
[Get Random points in Donut /Hollow Ring in Unreal Engine (With and without EQS) - YouTube](https://www.youtube.com/watch?v=KqXR4ykwkZc&ab_channel=ZODIGAMES)

---

<div class="post-metadata">

**Author:** ![the121230](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@the121230](https://forums.unrealengine.com/u/the121230)\
**Post date:** [January 30, 2023, 5:14pm UTC](https://forums.unrealengine.com/t/how-to-get-a-random-point-in-a-hollow-circle/453829/8 "2023-01-30T17:14:06Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/e/b/deb27555ba5344439da9fa5051e402e45bf2d6fd.png)  
I revise the BP so that the AI ​​to go behind to the player
