public void FixedUpdate() { //Swipe Detection DetectSwipe(); //Accelerometer Detection if (egg.accelEnabled) { Vector3 acc = Input.acceleration; egg.GetComponent <Rigidbody>().AddForce(acc.x * 20f, 0, 0); } //Left if (Input.GetKeyUp(KeyCode.A)) { egg.Left(1); } //Right if (Input.GetKeyUp(KeyCode.D)) { egg.Right(1); } //Up if (Input.GetKeyUp(KeyCode.W)) { egg.Up(1); } }