How do you make a sprint script actually change your speed?

I know how to make the script run an animation but i dont know how to change my actual speed. I want the script to increase my characters speed when I hit the shift button.

Assuming you use a character controller, you can set the speed in the script’s variables.

If you move your character with your own script, change the translation or force value, i.e. use higher values for speed in:

   transform.Translate(Vector3.forward * Time.deltaTime * speed);

Otherwise you can change the overall speed in the Project Settings/Time via Time Scale.