getkeydown keyboard arrows

Hey everyone.

I have a code that when the player touches (or clicks with mouse) any location on the screen it will go to it’s closest corresponding anchor point.

here is the example code of how i’ve restricted screen movement.

 _myPosition = _touchPosition;
 if (_myPosition.x >= 0f && _myPosition.x <= 3.5f && _myPosition.y >= -6f && _myPosition.y <= -1.2f)
        {
            _myPosition = new Vector3(1.74f, -2.4f, 0);
        }

I’m trying to figure out how to do this with the arrow keys. Im pretty sure I have write one for each arrow (ie keycode.leftarrow etc), but i’m not sure what the starting point is for

  if (input.getkeydown(keycode.leftarrow)
  {
          //what is supposed to go here to make it move from point 1 to point 2
  }

your best bet (aka easiest) is to make a list of the anchor points in the order you want people to scroll through them, and then when they hit left/right it simply iterates to the next point.
Otherwise you would have to take the dot product of the difference vector and the direction of choice vector(left/right/up/down) of each point and select the closest to 0.