Boolean doesn't change as I want

I have put boolean like this

function OnTriggerEnter(other : Collider){
	if(other.tag == "shot"){
		move = false;
		hurt = true;
		health--;
		Destroy(other);
	}
}

but it never change as I type in function update

function Update(){
	if(move && health > 0 && !hurt){
		GetComponent(NavMeshAgent).destination = target.position;
		animation.Play("walk01");
	}
	if(hurt && health > 0){
		animation.Play("damage01");
		hurt = false;
	}
	playerDistance = Vector3.Distance(player.transform.position, transform.position);
	if(playerDistance <= 1){
		if(!attacking && health > 0 && ! hurt){
			move = false;
			this.GetComponent(NavMeshAgent).Stop();
			animation.Play("attack01");
			Invoke("ApplyDamage", 1);
			attacking = true;
		}
	}
	if(playerDistance > 1 && playerDistance <= 10 && !attacking && health > 0 && !hurt){
		move = true;
		animation.Play("walk01");
	}
	if(playerDistance > 10 && health > 0){
		move = false;
		GetComponent(NavMeshAgent).Stop();
		animation.Play("idle");
	}
	if(health <= 0){
		die();
	}
}

I want hurt become true so the animation damage can run.

You will not get the OnTriggerEnter callback unless one or more of the objects have a rigidbody. I’m guessing neither of your objects has one.

This is a duplicate question. You’ve asked exactly the same in Damage Animation doesn't play - Unity Answers. Can someone please close this (or the other one)?

EDIT: Since you have 4 questions regarding the same piece of code, I suggest using the edit button to update your question instead of making new questions.

I’m used to C#, but I’ll try to point out what MAY be wrong.

Change this

     function OnTriggerEnter(other : Collider){
    if(other.tag == "shot"){
    move = false;
    hurt = true;
    health--;
    Destroy(other);
    }
    }

to this

     function OnTriggerEnter(other : Collider){
    if(other.gameObject.tag == "shot"){
    move = false;
    hurt = true;
    health--;
    Destroy(other);
    }
    }

Then the last part, I’d suggest restructuring your code so certain things are called before others. I’ve had that problem before with a bool where one was being called before the other just out of co-incidence.

Hope that helps!