+1
Under review

how to stop AI sliding when doing melee attack

mo D 2 months ago in Melee updated by Marti (Lead Developer) 4 weeks ago 3

Hello, my enemy slides to the character while the attack animation is playing and my character increases the distance. 

Is there any way I can avoid the sliding? 

I tried the root motion and stop following action, the result makes no difference.

Unity version:
2019.4.5f1
Game Creator version:
latest

I found the problem is caused by the follow character action. When the character doing the attack animation, during the recovery time, the character is allowed to move before the whole animation is finished. How can I stop the character to move before the attack animation is done?

+1

Is this issue only present when using behaviours? If so a quick fix I have used is setting a condition on the "follow player" node that checks if the invoker is attacking. 


The condition checks to see if "is attacking" is false, if so the invoker can follow the player and this should look like normal walking/Running.

If the invoker IS attacking, then the condition will be false, and the invoker won't slide to follow the player if the distance increases. It should finish it's attack, then run towards the player

Under review

As far as I recall, the character (enemy) should only be allowed to follow a target during the last frames of the recovery animation. More precisely, if the length of the animation if 1.5 seconds and the transition out field is set to 0.2 seconds, the character should start moving at 1.3 (1.5 - 0.2) seconds. 


This is done to make the characters feel less robotic and overlap different secondary animations.

Can you try decreasing the transition out field? To something like 0.1 seconds. If it doesn't work, please do let me know.