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