- Home /
Question by
benjimazza · Jan 21, 2012 at 12:31 PM ·
animation
activating animations
hey, how could i activate one animation using two buttons :/ i tryed this code below but pfft i don't know how to do it and i carnt find nothing out there to help me,
function Update()
{
if(Input.GetKey("W","mouse1"))
animation.play ("Shoot");
}
i know this is probably wrong but at least i had a go at doing it lol if anybody could help please help :)
Thanks
Comment
Best Answer
Answer by FLASHDENMARK · Jan 21, 2012 at 03:19 PM
function Update(){
if(Input.GetKey("W") && Input.GetKey("mouse 1"))
animation.play("Shoot");
}
You will have to check for 2 conditions using the && operator which obviously means "and". If you want to say "or" you will use the !! operator.
Your answer
![](https://koobas.hobune.stream/wayback/20220613063234im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Dice Value 1 Answer
Animation stoping!! 1 Answer
Expecting EOF found else?? 1 Answer
Playing root animation by it's node 0 Answers
Can the animation editor create local rotational data? 3 Answers