I am making a first person shooter, but you can see the body when looking down. I am using keydown and keyup to trigger animations, my question is, if the player is holding “control” to crouch, then also “w” or any direction, how do I combine these so that when they press “w” it doesn’t just play the normal walking animation. How do I script a hold control + wsad to walk while crouching.
Here is a script example:
function Update()
{
if(Input.GetKeydown(“control”))
{
// Plays the _____ animation - stops all other animations
animation.CrossFade(“crouch”);
}
}
function Update()
{
if(Input.GetKeyup(“control”))
{
// Plays the _____ animation - stops all other animations
animation.CrossFade(“stand”);
}
}