void OnTriggerEnter(Collider other){
if(other.attachedRigidbody){
GetComponent<Animator>().SetBool("Running", true);
GetComponent<Animator> ().SetBool ("Walking", false);
}
}
void OnTriggerExit(Collider other){
if(other.attachedRigidbody){
GetComponent<Animator>().SetBool("Running", false);
GetComponent<Animator> ().SetBool ("Walking", true);
}
}
So, basically what I want to do it set it up so that the enemy runs when I enter a trigger, and walks when I exit it. Problem is, he doesn’t do that. My animator controller is using a state called Idle, which is never used by the game, which can transition to walking and running. I also have 2 parameters called running/walking that are bools, but I don’t think they are referencing the animations. Can anyone tell me how to make this work? Currently, all he does is switch between running and waking constantly every second. Any help appreciated, thanks!