public void StartPlaying()
    {
        StopRecording();
        Replaying                           = true;
        PlayingIcon.enabled                 = true;
        StopIcon.enabled                    = false;
        inputField.interactable             = false;
        CharacterMovement.Character.CanMove = true;
        _FrameNumber                        = 1;
        Debug.Log("Replaying Frame " + _FrameNumber);
        _CurrentFrame = Libcheckers.GetFrameStateObject(1);
        Vector3 newCharPos = new Vector3(float.Parse(_CurrentFrame.GetStateVariableValue("charPosX")), float.Parse(_CurrentFrame.GetStateVariableValue("charPosY")), float.Parse(_CurrentFrame.GetStateVariableValue("charPosZ")));

        CharacterMovement.Character.SetPosition(newCharPos);
        Debug.Log(_CurrentFrame.ToString());
    }
 // Update is called once per frame
 void Update()
 {
     if (Recording)
     {
         _FrameNumber++;
         Debug.Log("Recording Frame " + _FrameNumber);
         LibcheckersFrameState frame = new LibcheckersFrameState(_FrameNumber, new List <LibcheckersInput>(), new List <LibcheckersState>());
         frame.InsertStateVariable(new LibcheckersState("deltaTime", ("" + Time.deltaTime)));
         if (KeysToListenTo != null)
         {
             foreach (KeyCode key in KeysToListenTo)
             {
                 string           name  = System.Enum.GetName(typeof(KeyCode), key);
                 LibcheckersInput input = null;
                 if (Input.GetKeyDown(key))
                 {
                     input = new LibcheckersInput(name, "d");
                 }
                 else if (Input.GetKeyUp(key))
                 {
                     input = new LibcheckersInput(name, "u");
                 }
                 else if (Input.GetKey(key))
                 {
                     input = new LibcheckersInput(name, "h");
                 }
                 if (input != null)
                 {
                     frame.InsertInput(input);
                 }
             }
         }
         if (ButtonsToListenTo != null)
         {
             foreach (string button in ButtonsToListenTo)
             {
                 LibcheckersInput input = null;
                 if (Input.GetButtonDown(button))
                 {
                     input = new LibcheckersInput(button, "d");
                 }
                 if (Input.GetButtonUp(button))
                 {
                     input = new LibcheckersInput(button, "u");
                 }
                 else if (Input.GetButton(button))
                 {
                     input = new LibcheckersInput(button, "h");
                 }
                 if (input != null)
                 {
                     frame.InsertInput(input);
                 }
             }
         }
         if (AxesToListenTo != null)
         {
             foreach (string axis in AxesToListenTo)
             {
                 float AxisValue = Input.GetAxisRaw(axis);
                 if (AxisValue != 0)
                 {
                     frame.InsertInput(new LibcheckersInput(axis, "" + AxisValue));
                 }
             }
         }
         Libcheckers.InsertFrameState(frame);
         Debug.Log(frame.ToString());
     }
     else if (Replaying)
     {
         _FrameNumber++;
         Debug.Log("Replaying Frame " + _FrameNumber);
         _CurrentFrame = Libcheckers.GetFrameStateObject(_FrameNumber);
         Debug.Log(_CurrentFrame.ToString());
         if (_CurrentFrame.Empty || _CurrentFrame.GetStateVariableValue("endRec").Equals("1"))
         {
             StopPlaying();
             Debug.Log("REPLAY OVER");
         }
         else
         {
             _DeltaTime = float.Parse(_CurrentFrame.GetStateVariableValue("deltaTime"));
         }
     }
 }