[SOLVED] Yanfly's Action Sequence "if" condition when attack is missed

Hi everyone.

I want to make certain animation that will be played only if an attack is hitting the enemy. Otherwise the animation shouldn't be played at all.

Can you tell me how to make it using "if" condition to check if an attack is hit or miss?
👋 Try something like this, seems to work for me~
Code:
action effect: target
if !target.result().missed && !target.result().evaded
  action animation: target
end
The if has to be after action effect. This example says "check hit chance, process the damage formula on hit; if the skill did not miss and the target did not evade, show the assigned animation on the target".
Wow, great. It worked for me.
Because without those method it will be weird seeing sword or spear animation and sound, but the attack is missed.

Thank you very much for your help.

Edited:

By the way, when the attack is missed, my character is not finishing his attack motion. If the attack motion has 3 frames, he only do 1 or 2 frames than back to his standby motion. It doesn't happen if the attack hits the enemy.
By the way, when the attack is missed, my character is not finishing his attack motion. If the attack motion has 3 frames, he only do 1 or 2 frames than back to his standby motion. It doesn't happen if the attack hits the enemy.
Oh, maybe try adding some wait time in there, e.g. after the if part:
Code:
perform action
action effect: target
if !target.result().missed && !target.result().evaded
  action animation: target
else
  wait: 12
end
I imagine it works OK with the animation because there's a wait for animation action somewhere, either in the same action phase or a subsequent one.
Thank you very much for your helps.
It works charmly.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/solved-yanflys-action-sequence-if-condition-when-attack-is-missed.110270/