How do I fix combat animations

So ive been working on my game learning combat animations and ive always liked in other rpgs like final fantasy when they attack normally they either run up and hit the badguy or stand back and shoot the bad guy if they have a ranged weapon, my problem is that i have it where when they attack the run up and hit the bad guy with a melee weapon but when i have a guy with a ranged weapon the also run up and hit, i also have a video to show what i mean.

Are you using Yanfly's Action Sequences for this? If you are, you can simply put an if-statement inside the sequence like this:

<target action>
if user.attackMotion() !== "missile"
move user: target, front base
wait for movement
end


perform action
motion wait: user
action animation
wait for animation
action effect: target
death break
</target action>

That way, the user will only run towards the enemy if he is not using a ranged weapon (attack motion is not "missile").
Ahhh thank you so much that totally worked!!!
My bow user is moving towards the enemy with the following code.. can anyone tell me why the bow user is not staying back?

<setup action>

if user.attackMotion() !=="missle"

camera focus: target

zoom: 120%, 20

camera offset: right, 50

else

camera focus: user

zoom:250%, 20

wait:20

camera focus: target

zoom:150%, 20

camera offset: right, 50

end

Immortal: targets, true

</setup action>



<target action>



If user.attackMotion() !=="missle"

move user: targets, front, 20

wait for movement

end

motion attack: user

wait:10

action animation: target

wait for animation



action effect

wait for animation

wait for movement

wait:5



</target action>
Unless you mistyped it here, you are missing an "i" in the word "missile" 😉 If that doesn't fix it, check which motion is assigned to the bow in the System tab of the database.
Omg you're right! Can't believe I missed that! Good eye, thanks!

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-fix-combat-animations.78918/