rotating ball with rigidbody attached

hello, I have code like this

if (Input.GetKey ("w")) {
rigidbody.AddForce (0,0,moveSpeed); 
}

if (Input.GetKey ("a")) {

        transform.Rotate (0, 0, 20000 * Time.deltaTime);

}

if (Input.GetKey ("s")) {
rigidbody.AddForce (0,0,-moveSpeed); 
}

Basically I have a ball with rigid body and I move it by adding force, now I want to rotate it when I click A and D. so it changes direction, I tried several rotations, including local rotate of transform, normal rotate and adding torque but ball spins in place, it kinda does not change direction. O_O its like unruly pet ball

if (Input.GetKey ("w")) { rigidbody.AddForce (0,0,moveSpeed); }

if (Input.GetKey ("a")) {

rigidbody.AddForce(moveSpeed, 0, 0);

}

if (Input.GetKey ("d")) {

rigidbody.AddForce(-moveSpeed, 0, 0);

}

if (Input.GetKey ("s")) { rigidbody.AddForce (0,0,-moveSpeed); }

i think the problem is that you're adding a force but always in the same direction (along positive z axis). you don't want to rotate the ball but rotate the force. try calculating a new force vector that is rotated in the direction you want to move and then add that force to the ball.

Try applying the force using AddRelativeForce

if (Input.GetKey ("w")) {
rigidbody.AddRelativeForce(0,0,moveSpeed); 
}

can you please just tell me a script that might work? You would be awesome and i would never get over it!