Limiting player movement

Hi, I am trying to limit the range that the player is allowed to move around the screen, but am having some trouble perfecting it.

What I currently have is a third person view, where the player is able to move around the screen within a certain radius. Basically, the character can only move around within a circle. To set these bounds, I am constantly checking the magnitude of the vector between where the character was spawned, and where they currently are. The character is a child of an empty gameobject that has been placed a set distance in front of it, and rotates with it.

I have tried something like

if( magnitude <= MAX_MOVE_RADIUS) { // Allow player movement }

However, when the player moves outside of the allowed bounds, there is no way to get them back. Does anyone have any suggestions?

Thanks in advance

There are some things I didn't understand about your post, but it sounds like what you're looking for is a closest-point-on-circle function, which can be implemented as follows (untested pseudocode):

// It's assumed that the query point is already known to lie
// outside the circle.
Vector3 diff = queryPoint - circleCenter;
return circleCenter + diff * circleRadius;