Dodge animations stopping all input animations

So in my project, all the animations work perfectly its just when i do any of the dodge animations too quickly, they seem to stop working. Would putting delays on the dodging help the situation or is it something else?

Hello oAnubus,
What do you mean by “they seem to stop working”? I used to have problems with my dodge animations too and I might be able to help if I know what kind of problem your running into. For example, does the animation even play? Does your other animation work after dodge? I don’t know a whole lot but depending on the exact issue I might be of use.

I have the dodge button all well and set up and lets say im mashing the button to dodge, then when i try to do the attack animations for any other animation other than dodge, they wont play at all.

Thanks for explaining. I figure out a couple of solutions, but it depends on how your system is set up. Here’s what you can try:

  1. If your not using Anim Montages, I highly recommend you do. Many people run into problems where after playing an Anim Sequence, their ABP stops working. Making Anim Montages for all your animations might fix this, but remember to add a “slot” node in your ABP so you can play Anim Montages.

  2. If your using a state machine, where you set your character to different states based on action (jump, attack, dodge, etc), you need to reset the state after performing any action. After resetting the state, your attack animations and other animations should work since your not currently in any state.

  3. If you using a branch node to check whether or not you are able to attack then might want to double check those. In my system I have a function that checks whether or not I can perform an action. For example, if “Is Falling” is not true, then I can attack and if “Is Falling” is true then I cannot attack.

Those are a couple of solutions I’ve came up with. Let me know if they work and remember it’s based on how your system is set up. If you don’t have a state machine I highly recommend you add one because it will limited the character from doing certain actions while in a state. (EX. Character cannot attack while dodging because it’s in the dodging state) With a state machine you can also create an hierarchy of actions where different action have higher or lower priority. (EX. If character is attacking and we hit the dodge button, then we stop attacking immediately and perform a dodge)

I use the second and third methods you recommended and it seems to fix more than one issue but the dodge is still cancelling out the inputs. Im thinking of raising the delay on when you can dodge and maybe that will help it out a bit? Doesnt hurt to try. :slight_smile: (This is my Attack and Dodge setups)

image

If you don’t want the dodge to cancel out your attack you might want to add a check to see if your attacking in the “Dodge/Block” event. That way if your attacking you cannot dodge. Also you might want to add a check to the “Light Attack” event so you don’t attack while dodging.

As for the delay for the dodge, I’m not sure how you want it, but I got an suggestion. Since your using the Montage Play node you can set the “Return Type” to “Duration” so you get a return value of the duration of the animation. If you want to reset you “Can attack” and “Can jump” variables you can use the return value of the Montage Play node as the delay. That way you can jump and attack as soon as the animation is finished. If you want a longer delay you can add a value onto the return value of the Montage Play node and set it as your delay and you get a bit of a delay after the animation is finished.
Hope that helps! :crossed_fingers:

Also where are you setting “IsDodging” to true? I don’t see where you set “IsDodging.”

The dodge macro and the attack setup are set up differently but play anim montage doesnt have a set duration

I changed the name of the boolean to help me understand it better and its set back to true after .9 seconds. (Set to true by default)

Before I get to the delays again, I was wondering, is your dodge is still cancelling out your inputs?

For the delays, I highly recommend a state machine (enums) within your blueprint. If you want to be able to jump or attack as soon as the dodge is finished or after a slight delay after the animation then it would be easier to manage with a state machine rather than having delays. If you like I would love to help you set up a state machine so you can get rid of a lot of the “set boolean” nodes and some of the delay and create functions to check weather or not you can perform a dodge, attack, or jump. It totally up to you! :+1:

Sure! Honestly, I want all the animations to be inside the state machine its just wrapping my head around getting it to work. I tried to look up videos on how to set up my attack animations inside the state machine, but they dont feel informative enough.

Also, yes its still cancelling the inputs.

Sorry for the late reply. :pray:

For the state machine I used gameplay tags and a actor component that handles all my states. Here’s how I did it:

  1. I set up gameplay tags. You can find and make gameplay tags in the Project Setting, on the left hand side there is a tab called gameplay tags.
  2. I then made a actor component with about four functions: Set State, Get State, IsCurrentStateEqualToAny, and Reset State. The Set State function just sets the state of the character and the Get State function returns the current state the player is in. The IsCurrentStateEqualToAny function checks a list of gameplay tags to see if any of them match the current state and returns a boolean value. The Reset State calles the Set State function but sets the state to nothing.
  3. I added the actor component to my player character. Before my player plays an animation (attack, dodge, etc) I set the state to the one that matches my action. I use the IsCurrentStateEqualToAny to check if the player can perform an action like attack or dodge.
  4. I created a Anim Notify so I can reset my state at the end of each animation. That way after an animation is completed I can play another animation right after it without it staggering. I placed the Anim Notify at the end or near the end of each Anim Montage.

This system might be a little hard to follow, but this system is very powerful. I can walk you through the whole if you don’t understand something. Just let me know!

Could you send me a video of the problem so I can get a better visual of the issue? Thanks! :+1: