I have a tiger model which has two animation walking and running i have made the transition and i want tiger to run when i press key i declared the animator component in strt method and was trying to set run variable in animator to 1 by code but it gave me this errror
NullReferenceException: Object reference not set to an instance of an object
NewBehaviourScript.Start () (at Assets/NewBehaviourScript.cs:15)
the code is below
void Start () {
anim=(Animator)this.GetComponent("animator");
anim.SetInteger("run",run1);
}