"Get Random Point in Radius" creates very romantic hearts :P

Often times more simple noise functions have artifacts in them. Though this is a bit unusual. Its likely a bug, due to how they are generating the points. Possibly from some ‘fast math’ approach given your radius, its having unusual floor/ceiling points.

I’d suggest just making your own get random point in circle function

Here is some Pseudo code
angle = random(0, 2pi); // pick a random direction
offset = random(0, radius); // pick a distance between 0 and the radius
x = offset * cos( angle ); // resolve the X coordinate
y = offset * sin( angle ); // resolve the Y coordinate

edit: I found something close to my pseudo code, Spawning randomly around edge of a circle and not in the center. - Blueprint Visual Scripting - Unreal Engine Forums you’d want to swap out radius min for some lower bound (maybe 0) otherwise that should help out.

Note, you may need to do 0, 360. I am not sure which is expected of UE4’s Math’s Sin and Cosine function
this gets a random distance from 0 to the radius, at a particular angle, and cos resolves x of that angle, and sin for y respectively.

after looking thru the source, it appears the function GetRandomPointInRadius is actually intended for something to do with pathfinding and navigation meshes. So the points are likely biased for pathfinding algorithms somehow, and since you aren’t giving it input for that, its getting it some other way.

If you want random points in a circle, I’d advise you write your own function that either uses what I provided, or look on the internet. I don’t think that function is intended for that purpose, even though it appears like it might.

2 Likes