2
I’m trying to make a command that activates an animation when I press 2 keys of Keyboard and when I stop pressing one of them, this animation stops. For example I chose the "w" + "leftShift" key, when both are pressed I want you to start the animation, "RUN". When I stop pressing "leftShift", I want it to start an animation of walking "WALK", and last when I stop pressing "w", I want it to start an animation of stopped "IDDLE". Could someone help me? Here’s the command I’m trying to make work:
if (Input.GetKey(KeyCode.LeftShift) + (Input.GetKey ("w"))) {
animationController.PlayAnimation (AnimationStates.RUN);
}
Because I tested this method worked out the only problem that is happening and when I drop the "shift" but keep pressing the "w", it keeps doing the animation of running, only when I drop the "w" and tighten again that it makes the animation of walking.
– Gustavo Bianco
That stretch is inside the
Update()
?– Leandro Angelo