Hello, I am trying to get one animation to play using mechanim so I made a trigger named Shoot and added it to the transition from anystate. I get an error saying that I need to assign the anim variable of the PlayerAnimator script in the inspector. But, when I go to the scrip in the inspector there is no variable slot for the anim. Here is my code, I followed a Unity tutorial.
using UnityEngine;
using System.Collections;
public class PlayerAnimator : MonoBehaviour {
Animator anim;
int shoot = Animator.StringToHash("Shoot");
// Use this for initialization
void Start () {
anim = GetComponent<Animator>();
}
// Update is called once per frame
void Update () {
}
public void Shoot()
{
anim.SetTrigger (shoot);
}
}