How to know how far away an edge of a union is ( fort battle royale game)

This is basically an extension of my previous question which is Best way to make barrier/storm? For battle royale game

But, I have figured out how to know how far away a player is etc. But I want to know how far the “barries/storm” is away from the middle.

I have one idea:
Casting a ray from the middle to the barrier and then getting the magnitude.
But is there another way, an easier way?
If so please answer, I would be very gratefull.


Hope this drawing helps to understand.

1 Like

Is the middle not just the center of the circle?

  • If it is, then the distance is the circles radius.
  • If it isn’t, then the distance to the closest edge is radius - distanceMiddleToCenter
2 Likes

Oh my, what did I think.
I did not even think about that, oof I feel so dumb right now :sweat_smile: :joy:
Thanks for the help!

1 Like