Kill Animation (change objects)

At the moment I try to make an kill animation when the player shoots an enemy. But when the player shoots an enemmy he disapperaed (which of coursed is wished) but the dying animation/object didn`t appear.

by the way; is there an option for “CHANGE object” ?

I used the old Mark Overmaas Game Maker before 15 years and there was an option for “change objects” which made it easy to create kill-animations or just change an object into another. But I couldn`t find such an option into the GDevelop.

For your second question, You cannot change objects.

For your first question, you probably need to ensure you are creating your kill object at rhe right z order to be infront of your background

The layer was correct. Just for testing I used the an other layer to create the object and it appears on the upper-left corner. It seems that the animation ever appeared on the upper-left corner. But how can I tell GDevelop that the Kill-animation shall appear exact on the spot where I killed the enemy ?

Looking at it again, 2 things:

  • Right now you’re telling it to create it at the X/Y position of your objects direction. You want to have it create at the object’s X/Y position, not it’s direction. So instead of ObjectName.Direction(), it’d be ObjectName.X() and .Y().

  • Z Order is not layer. Each single layer has infinite Z order positions. Make sure you adjust your created object’s position to be at least equal too or greater than your other object before deleting. This can be done with the Z order action, and you can find your other object’s Z order by ObjectName.ZOrder()

Like Silver-Streak says, every time you have an action to create an object, you have to change the Z order of you new object. Like this:


The Z order determine which object will show its sprite when there are 2 or more objects overlapping (your object may be covered for another sprite).
Depends of the case, many times is better just to do another animation for your enemy and when the enemy die just change the number animation of your enemy to the death animation.

The Z-Order is still a bit confusing to me but I will try to use it to understand this option too :slight_smile:

But meanwhile the kill animation worked perfect. :slight_smile: Thanks a lot for help.

Blockquote
Depends of the case, many times is better just to do another animation for your enemy and when the enemy die just change the number animation of your enemy to the death animation.
Blockquote

That was the first idea. But I feared that the kill animation had the same function like the enemy itself. I wanted to avoid that the kill animation is deadly to the player too.

Good, keep in mind that you can use the animation number of an object (in this case the enemy) as a condition for an event. So, you can restringe the events related to the enemy alive using the condition to get true the event that enemy number animation have to be x (the number animation that is alive). If you have more than 1 animation that enemy is alive, you can use the advance category “or” (II) and add to the condition inside the “or” all of the animation numbers when your enemy is alive.

Yo lo que hice para que la animación de muerto del enemigo, borre la mascara de colision de esa animacion, utilizando la opcion de mascara independiente de cada animacion. Al morir el enemigo, aparece la animacion de muerte y no afecta al player, porque no tiene mascara de colision y puedo pasar por encima del enemigo.

Espero haber entendido, lo que quiere