I created an enemy (with platformer behaviour) that detects if the player is in front of it using raycast. If the character is in front, it will go to the “windup” animation and eventually roll forward.
Problem is that sometimes instead of stopping when it is in “windup”, it slowly moves towards the player for a few seconds before winding and rolling.
How can I make it stop moving when it is in windup animation?