how to run Sprint

Help. I do not know how to do when you hold the left shift is a character starts to run and release it when the form starts normally go.
This is my script “Movement”

pragma strict

var animator: Animator;

var h: float;

var v: float;

function Start () {

animator = GetComponent (Animator);


function Update () {

h = Input.GetAxis (‘Horizontal’);

v = Input.GetAxis (‘Vertical’);

if (Input.GetButton (‘Jump’))

animator.SetBool (‘Jump’, true);


animator.SetBool (‘Jump’, false);

FixedUpdate function () {

animator.SetFloat (‘Speed​​’, v);

animator.SetFloat (‘directrion’, h);


You havent even done anything for the sprint function.
You must think what sprint is… it is just walking faster with a run animation.So just make it so when you press shift you have increased movement speed and to play a sprint animation.I will not give you the code since i belive you should learn the basics first.I sugest you watch Brackeys on youtube as his tutorials are awesome for newbie unity users.