So, I had this issue where I could click to walk around, then hit ‘G’ and use WASD to move around.
If you hit ‘G’ again, the character would immediately start running back to the last clicked position.
My solution was to clear the clicked position every time ‘G’ is pressed. It might not be necessary to do this when going from click to WASD/gamepad mode, but this while line will be moved to a menu later anyway…
private void FixedUpdate()
{
if (Input.GetKeyDown (KeyCode.G)) { // G for gamepad. TODO add to menu
isInDirectMode = !isInDirectMode; // toggle mode
currentClickTarget = transform.position; // reset click position
}