private void apply_movement(float horizontal_input, float vertical_input)
        {
            Vector3 move = new Vector3(0, 0, 0);



            //apply upwards momentum when jump
            if (state_controller.curr_state == (int)Player_State_Transition_Func.player_state.jump)
            {
                _velocity.y = Mathf.Sqrt(JumpHeight * -2f * Physics.gravity.y);
                AudioManager.instance.Play("JUMP");
            }
            else

            //apply backwards momentum when knocked back
            if (knockback_timer > 0)
            {
                if (knockback_direction_right)
                {
                    move += new Vector3(1, 0, 0) * Time.deltaTime * knockback_speed;
                }
                else
                {
                    move += new Vector3(-1, 0, 0) * Time.deltaTime * knockback_speed;
                }
            }

            //apply dodge movement to the player
            if (state_controller.curr_state == (int)Player_State_Transition_Func.player_state.dodge)
            {
                player_health_info.setInvincible(0.2f);
                dodge_invuln_timer = 0.2f;
                move += Player_controller_helper.getDodgeVector(horizontal_input, vertical_input) * Time.deltaTime * dodge_speed;
                AudioManager.instance.Play("DODGE");
            }
            //otherwise apply regular movement if not in an attack that locks movement
            else if ((attack_controller.curr_state == (int)Attack_State_Transition_Func.attack_state.not_attacking ||
                      attack_controller.curr_state == (int)Attack_State_Transition_Func.attack_state.attack_jump_0 ||
                      attack_controller.curr_state == (int)Attack_State_Transition_Func.attack_state.attack_dash_0) &&
                     (state_controller.curr_state != (int)Player_State_Transition_Func.player_state.parry_active &&
                      state_controller.curr_state != (int)Player_State_Transition_Func.player_state.parry_cooldown) &&
                     knockback_timer <= 0)
            {
                //apply horizontal movement
                move += new Vector3(horizontal_input, 0, 0) * Time.deltaTime * Speed;

                // steering the character
                if (attack_controller.curr_state != (int)Attack_State_Transition_Func.attack_state.attack_jump_0)
                {
                    lerpSpeed = 20 * Time.deltaTime;
                    if (move.x > 0)
                    {
                        rot = Quaternion.Euler(0, 0, 0);
                    }

                    if (move.x < 0)
                    {
                        rot = Quaternion.Euler(0, -180, 0);
                    }
                    transform.rotation = Quaternion.Slerp(transform.rotation, rot, lerpSpeed);
                }
            }


            apply_gravity();
            //apply all movement
            _character_controller.Move(move + (_velocity * Time.deltaTime));
        }
        // Update is called once per frame
        void Update()
        {
            if (!enable_control)
            {
                return;
            }

            float horizontal_input = Input.GetAxis("Horizontal");
            float vertical_input   = Input.GetAxis("Vertical");
            bool  pause_input      = Input.GetButtonDown("Pause");

            reload_scene_if_death();

            Player_Input.PlayerInput input = Player_controller_helper.getPlayerInput(ref combo_info, enable_attacks, enable_parry, enable_dodge, enable_laser);

            if (pause_manager.GetLaserPaused())
            {
                if (Input.GetButtonDown("Jump"))
                {
                    pause_manager.UnpauseLaser();
                    pause_manager.RemoveLaserTutorial();
                    pause_manager.PauseCombo();
                    pause_manager.ShowComboTutorial();
                }
            }

            else if (pause_manager.GetComboPaused())
            {
                if (Input.GetButtonDown("Jump"))
                {
                    pause_manager.UnpauseCombo();
                    pause_manager.RemoveComboTutorial();
                    Time.timeScale = 1f;
                }

                if (Input.GetButtonDown("Attack"))
                {
                    pause_manager.UnpauseCombo();
                    pause_manager.RemoveComboTutorial();
                    pause_manager.PauseLaser();
                    pause_manager.ShowLaserTutorial();
                }
            }

            pause_game(pause_input);

            if (pause_manager.GetPaused())
            {
                if (Input.GetButtonDown("Jump") && pause_visual)
                {
                    pause_manager.RemovePause();
                    pause_visual = false;
                }
                else if (Input.GetButtonDown("Jump") && !pause_visual)
                {
                    pause_manager.ShowPause();
                    pause_visual = true;
                }
                return;
            }

            //if parry_stop is active, check if it should be removed
            if (parry_stop)
            {
                Time.timeScale = 0f;
                if (Time.realtimeSinceStartup - parry_stop_initial > 0.3f)
                {
                    parry_stop     = false;
                    Time.timeScale = 1f;
                }
            }

            attack_controller.process_time();
            state_controller.process_time();

            bool state_changed = state_controller.process_state(input);

            process_attack_input(state_changed, input);
            if (attack_controller.curr_state != 0)
            {
                //attacking
                char_animator.Play(Utility_methods.GetDescription <Attack_State_Transition_Func.attack_state>((Attack_State_Transition_Func.attack_state)attack_controller.curr_state));
            }
            else
            {
                string desc = Utility_methods.GetDescription <Player_State_Transition_Func.player_state>((Player_State_Transition_Func.player_state)state_controller.curr_state);
                if (desc != "")
                {
                    char_animator.Play(desc);
                }
                //set animation to whatever else
            }

            process_parry(state_changed);

            setColour();

            apply_movement(horizontal_input, vertical_input);

            update_indicators();

            if (dodge_invuln_timer > 0)
            {
                dodge_invuln_timer -= Time.deltaTime;
            }

            if (knockback_timer > 0)
            {
                knockback_timer -= Time.deltaTime;
            }
        }