Player slows down the more thet look up or down.

Im making a FPS character and the more the player looks up or down, the slower the character gets, this doesnt affect moving from left to right.

  var projectedForward = Vector3.ProjectOnPlane(eyeCamera.forward * 100f, Vector3.up);

        var projectedRight = Vector3.ProjectOnPlane(eyeCamera.right, Vector3.up);

        isGrounded = Physics.CheckSphere(groundCheck.position, groundDistance, groundMask);

        if(isGrounded && velocity.y < 0)
        {
          velocity.y = -2f;
        }

        float x = Input.GetAxis("Horizontal");
        float z = Input.GetAxis("Vertical");

        Vector3 move = projectedRight * x + projectedForward * z;

        controller.Move(move * speed * Time.deltaTime);

        velocity.y += gravity * Time.deltaTime;

        controller.Move(velocity * Time.deltaTime);

The length of your projectedForward vector changes with the camera angle, it needs to be normalized to be used as a direction vector.

The same would happen to the projectedRight vector, if the camera was ever tilted left/right. Since it only ever tilts up/down or rotates around, the right vector will always stay parallel to the ground and its project length won’t change.

You want to normalize the move vector after creating it, this ensures the speed will stay constant whatever you do (you probably then need to decrease the speed to compensate the move vector now being one unit long instead of 100s).

what is eyeCamera?

if it is a transform you are checking for rotation, when you do eyecamera.forward its adding y into your vector which you dont want

The problem is when I normalize it, you keep moving for a bit after not pressing any key and you can’t walk diagonally.
I did this:

Vector3 move = Vector3.Normalize(projectedRight * x + projectedForward * z);

Hm, do you still have the * 100f in the calculation of projectedForward? This would mean that forward easily overpowers right if you press both.

Maybe it’s best to normalize both vectors before calculating move and then normalize it again. If you just remove the times 100, the diagonal will slightly change direction when up look up or down.

As for continuing walking when you let go, did you check the sensitivity and gravity settings in the input manager? They control how quickly axes change when you press/release keys.

the flawed part of your script is this field

eyeCamera.forward

you shouldn’t use the forward of your camera’s transform

you need to replace the eyeCamera in this code with an object that is rotated the same as your camera horizontally but not vertically

and how could i rotate an object only horizontally depending on the camera’s rotation?

I don’t agree. You’re basically achieving the same result with two different approaches and there’s nothing fundamentally flawed with the approach @whydowexist posted here. I think it’s smart.