Player Accelerates When Walking Off Platform

So, I’ve had a ton of problems in Unity, but I’ve managed to fix them all. The last one I’m faced with goes as follows:

When I jump/ walk off a platform, my player accelerates about twice as much as he should.

I really don’t understand this problem and have spent the past 6 hours trying to fix it, any help is greatly appreciated.

Here’s a video: help - YouTube

Here’s what my code looks like:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMove : MonoBehaviour {

    public CharacterController charController;
    public Camera cam;

    private int walkSpeed = 3;

    [SerializeField] private float jumpMultiplier;
    [SerializeField] private KeyCode jumpKey;

    private bool isJumping;

    void Awake() {

        charController = GetComponent<CharacterController>();

    }

    void Update() {

        MovePlayer();
        jumpInput();

    }

    private void MovePlayer() {

        float horiz = Input.GetAxis("Horizontal");
        float vert = Input.GetAxis("Vertical");

        if (Input.GetKey(KeyCode.LeftShift) && Input.GetKey(KeyCode.W)) {

            walkSpeed = 7;

        } else {

            walkSpeed = 3;

        }

        Vector3 moveDirSide = transform.right * horiz * walkSpeed;
        Vector3 moveDirForward = transform.forward * vert * walkSpeed;

        charController.SimpleMove(moveDirSide);
        charController.SimpleMove(moveDirForward);

        

    }

    private void jumpInput() {

        if (Input.GetKeyDown(jumpKey) && !isJumping) {

            isJumping = true;
            StartCoroutine(JumpEvent());

        }

    }

    private IEnumerator JumpEvent() {

        float vert = Input.GetAxis("Vertical");

        Vector3 moveDirForward = transform.forward * vert * (walkSpeed / 2);

        charController.SimpleMove(moveDirForward);

        charController.slopeLimit = 90f;

        do {

            charController.Move(Vector3.up * 10 * Time.deltaTime);

            yield return null;

        } while (!charController.isGrounded && charController.collisionFlags != CollisionFlags.Above);

        charController.slopeLimit = 45f;
        isJumping = false;

    }

}

Vector3 moveDirForward = transform.forward * vert * (walkSpeed / 2);
Transform.forward is in front of the object, not above it. You are also calling the same line:

 charControlller.SimpleMove(moveDirForward);

twice. Once from the MovePlayer() function and once in the enumeration with slightly different values. I suspect you don’t want the enumeration one unless you want the player to be forced forward when jumping? If that’s the case you might want to put a if (!jumping) before your simple move in MovePlayer().

Also while the enumeration is going on this line:

charController.Move(Vector3.up * 10 * Time.deltaTime);

Is getting repeatedly called and I suspect stacking on top of each other causing the acceleration.

If none of the above is right and I’ve read your code horribly wrong then I suggest looking into the settings you have for the Rigidbody on your character as that can alter the way objects fall thus might be causing the acceleration bug. Try lowing your mass or turning off gravity and adding it in via code.