How to call animations once in the tick function?

I wanna call a death animation once in the tick function and then destroy the actor. How could I only play the animation once and when it finishes it destroys the actor.

Hey @ShadowSprite123!

I can’t think of a scenario when Event Tick would be the best place to trigger a death animation. I’d recommend handling it another way, but if you really want to, you can achieve your objective using the Do Once node.

You can use the Play Montage node to play your animation, which has an On Completed pin that is triggered once the animation is over.


About Montages

You can create an anim montage by right clicking on your animation sequence from the content browser, hover over the Create section on the menu that pops up, and hit the Create AnimMontage option. And don’t forget to have a default slot plugged into the main output pose of the Anim Graph in your anim blueprint. You can get that node by right clicking on an empty space in the anim graph, search for “default slot” on the menu that pops up, and hit the "Slot ‘DefaultSlot’ " option. Now in the Event Graph of your character blueprint, you can play the montage by either using the Play Anim Montage or the Play Montage node. As for the former, just select the montage from the dropdown menu on the Anim Montage pin of the node. For the latter however, make sure to plug in the SKM into the In Skeletal Mesh Component pin. You can drag the SKM from the Components window on the top left into the Event Graph.

Hope these help! :innocent:

1st you have have to call take damageEvent in this function you should count the health 100 to 0, if it match the zero, simply call the dead function which you create in the seprate block like it should be include the sound of the character condition must be if bIsdead , apply the death sound and , also check if deathMontage && getmesh then play animation montage for some second, else destroy the character