How do I make the animation trigger on collision?

hello I am trying to make this animation trigger on collision with enemy but nothing happens.

I’m not sure why you have a sub event for this. Just remove the sub event and bring the play animation event into the same event section as the others. It should work fine then. If it doesn’t there might be a problem with your collision mask or bounding box.

like this right?

still not working, what do you think the issue could be with the collision mask or bounding box?


Are you sure the event is being executed? When the collision happens is the dynamite being deleted and is enemy losing a point of health? If the collision is for sure happening then it could be an issue with the animation. If the health isn’t being decreased and the dynamite isn’t being deleted then like I said it could be an issue with the collision.

If the answer is the latter, then can you take a screenshot of the dynamite and enemy in the editor scene. With the objects properties and bounding box shown clearly (you’ll need 2 screenshots).

yeah the collision is working and the damage/delete is working as well.

any suggestions with the animation?

Interesting can you take a screenshot of the animation frames. In the edit object window on the scene editor

sure here you go,

the animation plays well, and I can drag it onto the floor fine, I just cant get it to trigger when the dynamite is deleted for some reason.

I just realized that “explosion” is another object, now I see what the problem is, you have to create the explosion object when the dynamite collides with enemy and then play the animation after explosion is created.

okay do you know how I can go about that? I think I tried that method earlier but I may have done it wrong.

Yep it’s quite easy actually, before you delete dynamite, create an explosion object at dynamites centerX and centerY coordinates.

1 Like

you’re a legend mate :slight_smile: thank you! got it working perfect now!!!

No problem, glad it works!

1 Like