private void Update() { var x = target.transform.position.x; var y = target.transform.position.y; switch (word) { case "on": break; case "off": break; case "light": break; case "speaker": break; case "light on": x -= speed; petController.lightsOn(); word = ""; break; case "light off": x += speed; petController.lightsOff(); word = ""; break; case "speaker on": y -= speed; petController.speakerOn(); word = ""; break; case "speaker off": y += speed; petController.speakerOff(); word = ""; break; default: break; } target.transform.position = new Vector3(x, y, 0); }