WASD movement sliding around

The following is code for standard FPS style movement. I got this code from my text book, except I added: speed = 0.1f;
The script is a component of Main Camera which also has a ‘Rigidbody’ and ‘Capsule Collider’.
Unfortunetly there is some buggy sliding around the ground (like slipping on ice). I consulted the text book, and read that in the Inspector, Rigidbody’s variable “Drag” needs to be set to 1.
I did this, and it helped a little, but I’m still seeing the bug. Is there a reason it’s doing this in the first place?

EDIT: I noticed this is only happening when Main Camera collides with other “Collidable” 3D objects. Perhaps I need to learn more about the physics features.

using UnityEngine;
using System.Collections;

public class FPSMove : MonoBehaviour
{

    // Use this for initialization
    void Start()
    {
    }

    // Update is called once per frame
    public float speed;
    void Update()
    {
        speed = 0.1f;
        if (Input.GetKey(KeyCode.W))
        {
            transform.position += transform.forward * speed;
        }
        if (Input.GetKey(KeyCode.S))
        {
            transform.position -= transform.forward * speed;
        }
        if (Input.GetKey(KeyCode.A))
        {
            transform.position -= transform.right * speed;
        }
        if (Input.GetKey(KeyCode.D))
        {
            transform.position += transform.right * speed;
        }
    }
}

hm, it’s not great that the book tells you to use Rigidbody and a Capsule Collider; CharacterController was made for controlling a character.

I don’t think we need to go to a CharacterController for this. You don’t especially need the Rigidbody either, though, since you’re directly updating the position of the transform.

One thing I do see is that you should multiply speed by Time.deltaTime, or else your speed will depend on the framerate. (Be sure to increase speed to 6 or so to compensate.)

Take the Rigidbody off, or make it kinematic, and I think the slippy-sliding will go away.