switch (PlayerState) { case "IDLE": if (direction == 4) { PlayerState = "RUNNING"; transform.Translate(-.1, 0, 0); }; if (direction == 8) { PlayerState = "RUNNING"; transform.Translate(.1, 0, 0); }; break; case "RUNNING": break; }