Zombie Attack Animation script
I need to make an attack script that allows the zombies to play an attack animation and deal damage whenever they collide with me. I already got the zombies to follow me and have an animation play when they move, but I got that to work with an animation controller. How do I get the zombies to play an animation when they to close to the player while dealing damage? Help!
Answer by Zoogyburger · Feb 15, 2016 at 04:27 AM
do something like this:
#pragma
function OnCollisionEnter(aCollision : Collision){
animation.Play("animation name");
if(hit.gameObject.name == "player"){
Destroy(gameObject);
just make sure your player is named player.
Your answer

Follow this Question
Related Questions
Player's collider not detecting hits from animated enemy 0 Answers
Stop animation when bullet collides with target 0 Answers
Destry object on collision with 'bullet' 0 Answers
how to add animation in if statment?? 0 Answers
Check for collision while animating 0 Answers