I am trying to make it so my model does animations on a button press. So w for walking and so on. Can someone guide me to make a script for a var as well? So when I edit the character I can select the animation for the button pressed, like the default third person.
//You could put as many of these as you want for more animations
var animationToPlay1 : String;
var keyToPress1 : KeyCode;
var animationToPlay2 : String;
var keyToPress2 : KeyCode;
function Update()
{
if(Input.GetKey(keyToPress1))
{
animation.CrossFade(animationToPlay1);
}
if(Input.GetKey(keyToPress2))
{
animation.CrossFade(animationToPlay2);
}
}
i have an question how can i put a gui texter or gui button it and this script dosent have any gui option so how can i make it i want to use it in android phone and tab so can you help