Player object falling slowly when holding input

Hello! I’ve recently encountered a problem with my player GameObject. When I hold other buttons while it’s falling, it falls MUCH slower than normal. I don’t want this, is there some way to fix that? But, I still want to be able to change direction while falling. Here is my script:

var MoveSpeed : float = 100f;

var RunSpeed : float = 200f;

var Forward : float = 150f;

var ForwardRun : float = 300f;

var JumpHeight : float = 7500f;

var Jumped = false;

function Start ()
{
	rigidbody.freezeRotation = true;
}
function Update ()
{
	if(Input.GetKey(KeyCode.Space) && !Jumped)
	{
		Jumped = true;
		rigidbody.AddForce(Vector3.up * JumpHeight * Time.deltaTime);
	}
	//Player movement
	if(Input.GetKey(KeyCode.W))
		rigidbody.velocity = transform.forward * Forward * Time.deltaTime;
	if(Input.GetKey(KeyCode.S))
		rigidbody.velocity = transform.forward * -MoveSpeed * Time.deltaTime;
	if(Input.GetKey(KeyCode.D))
		rigidbody.velocity = transform.right * MoveSpeed * Time.deltaTime;
	if(Input.GetKey(KeyCode.A))
		rigidbody.velocity = transform.right * -MoveSpeed * Time.deltaTime;
	//Player run movement
	if(Input.GetKey(KeyCode.LeftShift))
	{
		if(Input.GetKey(KeyCode.W))
			rigidbody.velocity = transform.forward * ForwardRun * Time.deltaTime;
		if(Input.GetKey(KeyCode.S))
			rigidbody.velocity = transform.forward * -RunSpeed * Time.deltaTime;
		if(Input.GetKey(KeyCode.D))
			rigidbody.velocity = transform.right * RunSpeed * Time.deltaTime;
		if(Input.GetKey(KeyCode.A))
			rigidbody.velocity = transform.right * -RunSpeed * Time.deltaTime;
	}
}
function OnTriggerStay ()
{
	Jumped = false;
}

What is happening is that the velocity isn’t accelerating downwards. You set rigidbody.velocity.z to 0 every frame. There are many ways to solve this problem, here is one:

    float fallVelocity = rigidbody.velocity.z;
   //Player movement
    if(Input.GetKey(KeyCode.W))
       rigidbody.velocity = transform.forward * Forward * Time.deltaTime;
    if(Input.GetKey(KeyCode.S))
       rigidbody.velocity = transform.forward * -MoveSpeed * Time.deltaTime;
    if(Input.GetKey(KeyCode.D))
       rigidbody.velocity = transform.right * MoveSpeed * Time.deltaTime;
    if(Input.GetKey(KeyCode.A))
       rigidbody.velocity = transform.right * -MoveSpeed * Time.deltaTime;
    //Player run movement
    if(Input.GetKey(KeyCode.LeftShift))
    {
       if(Input.GetKey(KeyCode.W))
         rigidbody.velocity = transform.forward * ForwardRun * Time.deltaTime;
       if(Input.GetKey(KeyCode.S))
         rigidbody.velocity = transform.forward * -RunSpeed * Time.deltaTime;
       if(Input.GetKey(KeyCode.D))
         rigidbody.velocity = transform.right * RunSpeed * Time.deltaTime;
       if(Input.GetKey(KeyCode.A))
         rigidbody.velocity = transform.right * -RunSpeed * Time.deltaTime;
    }
    rigidbody.velocity += Vector3.down * fallVelocity;

Some suggestions I would like to make. Physics calculations are best done in FixedUpdate. Input.GetAxis makes it easy so that you don’t have to do all these if’s. Hope this helps.

It looks like your question have been solved, but I just want to say that there is a better way for writing player movement. It will safe time, and run better.

float speed = 30.0f;

void Update()
{
       float hor = Input.GetAxis("Horizontal");
       float ver = Input.GetAxis("Vertical");

        Vector3 move = (hor * speed * Time.deltaTime) + (ver * speed * TIme.deltaTime);

        transform.Translate(move);
}