Literally just made a state machine with movements only and was wondering how to get attacks in there and this is the first video that popped up when i searched! Thanks man!
This series was super helpful. I really appreciate your style of presentation. I was about to give up on making a node-based state machine before I stumbled on your video. So Thank you.
That's brilliant! Thanks for the feedback! I've been inspired by so many other content creators on UA-cam who have helped me immensely, so I'm glad I could help you out in some small way... I have more videos planned for this series, so please subscribe if you've not done so already ;)
Thanks very much! Glad to hear it helped! I've got more videos planned but am going through a busy patch at the moment with work so my video productivity has taken a hit... Will be back on it soon though I hope!
Nice tutorial. May I ask how to make combos like this using animation trees? Since I'm using animation trees for the player's other animations, I want to add combo attacks that way, but I couldn't find any proper tutorials on that.
For these examples I'm trying to keep things as simple as possible. I use Animation Trees in some instances though, it really depends on what you want to achieve. For example, in my recent 3D game jam game I use an animation tree to blend 3D animations and no state machine at all!
Hi, based on the code in the video it looks like when the character is in the air but is also in the attack state, the character won't change it's state to the air state but waits the animation until it's finished and the state will change to the idle state and eventually to the air state. Am i right? (Sorry for my bad english) Thank you
As someone who refused to do player state machine and instead operates on shitton of boolean variables addapting knowledge from this tutorial to my project will be complicated
i have an issue , i have a pretty similar node based state machine, i have only 2 attacks not 3 , Attack1 and Attack2, when i press the attack button , both animations play, i dont have the function get_input_direction so what i did different is just : if not animation_player.is_playing() or player.can_attack: state_machine.transition_to("Idle") i dont really know how to fix that im a newbie in coding... any help? Edit: if i put the Attack1 in the next state of Attack2 when i press the attack button both Attack1 and Attack2 animations and then if i press in time it does Attack1 again, so the code seems to work, may that helps to find the problem , sorry if it create confusion Edit 2 : i added Attack3 node with another attack animation , Attack1 and Attack2 still play togheter.. but in attack2 if i press at the right time attack3 start , and when i press attack , i dont go in the attack state till i press the button for attack3
Hmmm... it's a little hard to diagnose without seeing the code tbh... It sounds like whatever trigger you have set to detect the first attack is also valid for the second one and so is calling that too? That or maybe the state machine is moving straight onto the next state as soon as it fires the first animation. I would suggest putting some print statements in so that you can see when they are being triggered and in what order.
@@stingly what i did for solving the issue at the moment was putting an attackmanager node to play a 0.1 frame animation and then it proceeds to the combo, the issue is still there but i got around it in that way , since is still an issue i can say that if i press the attack button and print the current state , Attackmanager is the only state that is being printed , but attack1 is being played , and if i print the next state it prints attack1 , do you think is that big of an issue if i leave it like i did previously? becasue it seems like a real mess xD
Hey I just wanted to ask a question. How long did it take you to become a developer and learn also how long did it take you to create darius kinghtsbane
I'll answer the second question first, as it's easier: It took me 1 month to create Darius Knightsbane - it was for the Metroidvania Month XV Jam. That was working only in evenings though as I have a full-time job... This brings me to the first question: I've been an online software developer for 20 years, however, I started writing games in my spare time using Godot about 2 years ago. I had tried to create games before that point, initially in ActionScript, then Unity, but neither worked for me :)
I guess that would depend on how different the attacks were... I would track the equipped weapon with a variable in the player script and then trigger the correct animation within the attack state... of course, if you didn't want to have multiple attack animations for each weapon (maybe the staff only has 1 instead of the swords 3) then you would need to add that clause to the code to transition to the next state...
@@neeshchiiking that's actually bad, using signals for that is... bad practice. The best approach would be the strategy design pattern to modify the states based on each weapon and using an animation tree to Handle the animations.
@@cloudmindead5560 My PLAYER has the animation tree and MY PLAYER script has a state machine and when I pick up an item.type and use it, I emit a signal in which my signal manager hears and my Player script is connected to the signal manager SignalManager.connect("axe_used", self, "_on_axe_used") and function the function just has... state = AXE and that goes into my state machine that handles the rest... any help to improve this set up is appreciated
Literally just made a state machine with movements only and was wondering how to get attacks in there and this is the first video that popped up when i searched! Thanks man!
Perfect! Hope it helps!
Can't believe I found a channel before it blew up in popularity.
I appreciate your videos so far.
Welcome! And thanks very much!
This series was super helpful. I really appreciate your style of presentation. I was about to give up on making a node-based state machine before I stumbled on your video. So Thank you.
That's brilliant! Thanks for the feedback! I've been inspired by so many other content creators on UA-cam who have helped me immensely, so I'm glad I could help you out in some small way... I have more videos planned for this series, so please subscribe if you've not done so already ;)
Great video man, actually helped a ton! Hope your channel keeps growing :)
Thanks very much! Glad to hear it helped! I've got more videos planned but am going through a busy patch at the moment with work so my video productivity has taken a hit... Will be back on it soon though I hope!
Very helpful tutorial, thank you!
Awesome Tutorial Man!!
Glad you liked it! Thanks!
nice tutorial
Nice tutorial!
Thanks!
Nice tutorial. May I ask how to make combos like this using animation trees? Since I'm using animation trees for the player's other animations, I want to add combo attacks that way, but I couldn't find any proper tutorials on that.
thanks i understood state machines perfectly but why did you not use animation trees? are they not necessary?
For these examples I'm trying to keep things as simple as possible. I use Animation Trees in some instances though, it really depends on what you want to achieve. For example, in my recent 3D game jam game I use an animation tree to blend 3D animations and no state machine at all!
is this still possible when im using animated sprite ? instead of an animation player?
Hi, based on the code in the video it looks like when the character is in the air but is also in the attack state, the character won't change it's state to the air state but waits the animation until it's finished and the state will change to the idle state and eventually to the air state. Am i right? (Sorry for my bad english) Thank you
As someone who refused to do player state machine and instead operates on shitton of boolean variables addapting knowledge from this tutorial to my project will be complicated
i have an issue , i have a pretty similar node based state machine, i have only 2 attacks not 3 , Attack1 and Attack2, when i press the attack button , both animations play, i dont have the function get_input_direction so what i did different is just : if not animation_player.is_playing() or player.can_attack:
state_machine.transition_to("Idle")
i dont really know how to fix that im a newbie in coding... any help?
Edit: if i put the Attack1 in the next state of Attack2 when i press the attack button both Attack1 and Attack2 animations and then if i press in time it does Attack1 again, so the code seems to work, may that helps to find the problem , sorry if it create confusion
Edit 2 : i added Attack3 node with another attack animation , Attack1 and Attack2 still play togheter.. but in attack2 if i press at the right time attack3 start , and when i press attack , i dont go in the attack state till i press the button for attack3
Hmmm... it's a little hard to diagnose without seeing the code tbh... It sounds like whatever trigger you have set to detect the first attack is also valid for the second one and so is calling that too? That or maybe the state machine is moving straight onto the next state as soon as it fires the first animation. I would suggest putting some print statements in so that you can see when they are being triggered and in what order.
@@stingly what i did for solving the issue at the moment was putting an attackmanager node to play a 0.1 frame animation and then it proceeds to the combo, the issue is still there but i got around it in that way , since is still an issue i can say that if i press the attack button and print the current state , Attackmanager is the only state that is being printed , but attack1 is being played , and if i print the next state it prints attack1 , do you think is that big of an issue if i leave it like i did previously? becasue it seems like a real mess xD
Hey I just wanted to ask a question. How long did it take you to become a developer and learn also how long did it take you to create darius kinghtsbane
I'll answer the second question first, as it's easier: It took me 1 month to create Darius Knightsbane - it was for the Metroidvania Month XV Jam. That was working only in evenings though as I have a full-time job... This brings me to the first question: I've been an online software developer for 20 years, however, I started writing games in my spare time using Godot about 2 years ago. I had tried to create games before that point, initially in ActionScript, then Unity, but neither worked for me :)
My question is how do you change the attack depending on the weapon? Sword, Hammer, Staff, Fists
I guess that would depend on how different the attacks were... I would track the equipped weapon with a variable in the player script and then trigger the correct animation within the attack state... of course, if you didn't want to have multiple attack animations for each weapon (maybe the staff only has 1 instead of the swords 3) then you would need to add that clause to the code to transition to the next state...
For that one of the best and cleaner approaches is to use the Strategy design pattern, allowing you to change the attack state class behaviour.
Idk if it’s how you go about it… but I decided to make equipment usable items and depending on the type sword, bow, staff etc. I signal the animation
@@neeshchiiking that's actually bad, using signals for that is... bad practice.
The best approach would be the strategy design pattern to modify the states based on each weapon and using an animation tree to Handle the animations.
@@cloudmindead5560 My PLAYER has the animation tree and MY PLAYER script has a state machine and when I pick up an item.type and use it, I emit a signal in which my signal manager hears and my Player script is connected to the signal manager SignalManager.connect("axe_used", self, "_on_axe_used") and function the function just has... state = AXE and that goes into my state machine that handles the rest... any help to improve this set up is appreciated
Can i ask you. Is that video for people who is beginner cus i didn't get nothing from this one.
Goood
Thanks!