animation potition

Hi, I have animation shooting but the Enemy play animation In a certain direction, How can i Make the animation of enemy in the direction of the player thank you;

I don’t really get it but do you want to enemy to turn when the animation starts or when the enemy gets hit?

put in script of enemy if you want him to turn when animation starts:

if(player.animation.IsPlaying ("shooting"))
{
    transform.lookat (player.transform);
    animation.Play (enemyAnimationToPlay);
}

of course you need to create a variable called player in your enemy script for this.

also check in this if statement if the player is close enough or else all your enemy’s with this script will look at your player regardless of distance from the player :P.

hope this helps.

Try to do a rotation on componente transform, change rotation Y=0 to rotation Y= 180.

The sprite ( If it is 2D obvious ) will face player.

And if I’m not wrong you can change it when you anímate the GameObject on panel Animation.