G
garcj299
Guest
So I have an enemy with its idle animation and death animation in the same sprite, and once it is killed it's supposed to do the death animation and then destroy that instance. Here's the code:
//animation and death animation
if (death_animation = true)
{
if (image_index = 33)
{
instance_destroy();
}
}
else //idle animation
{
if (image_index >= 8)
{
image_index = 1;
}
}
but for some reason once death_animation is true, it just continues doing the whole animation and not destroying even once the image_index = 33. I tried using the end animation event but couldn't get it to work. Any ideas?
//animation and death animation
if (death_animation = true)
{
if (image_index = 33)
{
instance_destroy();
}
}
else //idle animation
{
if (image_index >= 8)
{
image_index = 1;
}
}
but for some reason once death_animation is true, it just continues doing the whole animation and not destroying even once the image_index = 33. I tried using the end animation event but couldn't get it to work. Any ideas?