i have problem with animation play via script

i have have a rigged model of people they walk around the player i want to when i shoot they dead i put the walk animation into it in animator controller but how can i play dead animation when player shoot the people

You can use the animator.setBool(“die”,true) something like that. You need can add a boolean condition from any state to dead state ~

this my animator i take a boolean dead variable in transection walk to dead

You need to set transition condition “Dead” to true in inspector, in image it is false. then from script call

GetComponent<Animator>().setBool("Dead",true);

it will start dead animation.