Hello,
I’ve been trying to create a death animation for an enemy object in my scene.I created an animation on an empty object in which i placed all my child objects like hands and legs.I animated them but now everytime I try to use the animation at a different position the object plays the animation,but not at the current positon.
I made these two screenshots so maybe they could help u to help me.
This is my death script(the one I use to play the animation) :
var enemy : Transform;
var ai : Ai;
var aiDeath : AIDeath;
function Start()
{
ai = enemy.GetComponent(Ai);
aiDeath = enemy.GetComponent(AIDeath);
}
function OnTriggerEnter(col : Collider)
{
if(col.gameObject.tag=="Bullet")
{
enemy.animation.Play("HeadShot");
Destroy (ai);
Destroy (aiDeath);
}
}
Thank you for your time!