+1 vote

So - I already have a melee attack set up with a state machine that switches to the attack state when a button is pressed - and back to the move state when the animation ends. What I want is to simply create one or two more attacks that can optionally follow up the first attack if the player repeatedly presses the attack button in sequence. How would I go about something like this?

in Engine by (15 points)
edited by

1 Answer

0 votes

Consider looking into the AnimationTree node. Another alternative is to build a state machine.

Here are some links to get you started:

https://docs.godotengine.org/en/stable/classes/class_animationtree.html

https://www.youtube.com/watch?v=CPDlaKWnQPM

https://www.youtube.com/watch?v=BNU8xNRk_oU

by (864 points)

Like I said - I already have a state machine and animationtree set up for movement and attacking - I’m just not sure how to incorporate combos.

Create a new state that can only be entered from the "attacking" state for the next step in the combo. Repeat the process so there is yet another state that can only be entered from the "attacking-combo-1" state for the next step in the combo. Repeat until you reach the desired complexity. For example, adding different states depending on which attack button is pressed.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.