In my game I’m trying to disable a navMeshAgent using a bool from an animatorController (tried the normal bool, didn’t work for some reason) But after I have scripted the bool to change and disable the mesh I get this error. error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer Id like to know what this means and how i can fix it. Here is my script for reference.
public class ZobieAnim : MonoBehaviour {
Animator Z_Anim;
public NavMeshAgent agent;
// Use this for initialization
void Start () {
Z_Anim = GetComponent<Animator> ();
}
// Update is called once per frame
void Update () {
bool IsDying = Input.GetKey("e");
Z_Anim.SetBool ("IsDead", IsDying);
//This is where the error is
if (Z_Anim.GetBool ("IsDead") = true) {
agent.enabled = false;
}
}