can i have 2 movement animations at once

so i have a walk and sprint animation, and scripts for each, when i have them running individually they’re fine but when i put the together, say for example wanting to sprint, it instead plays the walk animation, because i press “w” and “left shift” so it doesn’t play the sprint animation. here is the script

function Update () {
if (Input.GetKey(“left shift”))
GetComponent.().Play(“sprint v.2”);
}
if(Input.GetKeyUp(“left shift”))
{
GetComponent.().Stop(“sprint v.2”);
}

You might want to look into animation blend trees: Simple Blend Trees in Unity and Blend Trees - Unity Official Tutorials