Say I have a point in a Vector3, and my FPSController (I'm using the standard one that comes with Unity 5) moves a magnitude of 10 away from this Vector3. I want to not allow movement, in any direction, beyond magnitude 10. Ideally, I would anticipate which direction the player pressed to move in, test that vector, and if it's below magnitude of 10 then it'll allow the movement to proceed. That way, if you're at 10 and press "back", you wont be able to move but if you press "forward" then no problem.
I know I'm being a bit abstract here. From what I understand the FPSController.cs script is using the CharacterController component. I've studied the FPSController code for awhile tonight and notice it's doing all sorts of calculations on the local position, but the magnitude needs to be between two world coordinates.
I know how to calculate the magnitude already, all I need to know is how to test the anticipated direction. I have a feeling it's easier than I think?