# Find random point on a circle with a radius of x and the players position as center (unity)

First of all please note that the game is in 3d and Not 2d

The image below is seen from above. What I am trying to do is find a random point 2 - 3 meters around the player.

However I am not quite sure how to achieve it:

I have tried the following:

Vector3 randomPointOnCircle = Random.insideUnitSphere;
randomPointOnCircle.Normalize();
return randomPointOnCircle;


However I am not sure how to set the player as the center?

Star - Player

Square the general ground

Circle - A visual representation of where the points should be around the player

• Your current code selects a point on a sphere, not on a circle. Is that intentional? Jun 10 '20 at 17:53

Vector3 RandomPointOnXZCircle(Vector3 center, float radius) {