Tutorial: Adding COMBO ATTACKS to our state machine player controller in Godot 3.5

Поділитися
Вставка
  • Опубліковано 19 гру 2024

КОМЕНТАРІ • 38

  • @wh33landaxel1
    @wh33landaxel1 Рік тому +13

    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!

    • @stingly
      @stingly  Рік тому +1

      Perfect! Hope it helps!

  • @gimligimlass5509
    @gimligimlass5509 2 роки тому +4

    Can't believe I found a channel before it blew up in popularity.
    I appreciate your videos so far.

    • @stingly
      @stingly  2 роки тому

      Welcome! And thanks very much!

  • @kanmiafolabi5024
    @kanmiafolabi5024 2 роки тому +3

    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.

    • @stingly
      @stingly  2 роки тому +1

      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 ;)

  • @jvsvogler
    @jvsvogler 2 роки тому +1

    Great video man, actually helped a ton! Hope your channel keeps growing :)

    • @stingly
      @stingly  2 роки тому +1

      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!

  • @themonadoman116
    @themonadoman116 2 роки тому

    Very helpful tutorial, thank you!

  • @Couch_potato01
    @Couch_potato01 2 роки тому

    Awesome Tutorial Man!!

    • @stingly
      @stingly  2 роки тому

      Glad you liked it! Thanks!

  • @aliham4219
    @aliham4219 2 роки тому

    nice tutorial

  • @indieology7336
    @indieology7336 2 роки тому

    Nice tutorial!

  • @dennisquinn8622
    @dennisquinn8622 Рік тому

    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.

  • @Lukifah
    @Lukifah 2 роки тому

    thanks i understood state machines perfectly but why did you not use animation trees? are they not necessary?

    • @stingly
      @stingly  2 роки тому

      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!

  • @skrubboi1233
    @skrubboi1233 4 місяці тому

    is this still possible when im using animated sprite ? instead of an animation player?

  • @unfunnyman76
    @unfunnyman76 Рік тому

    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

  • @tonie5657
    @tonie5657 6 місяців тому

    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

  • @Kroklark
    @Kroklark Рік тому

    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

    • @stingly
      @stingly  Рік тому

      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.

    • @Kroklark
      @Kroklark Рік тому

      @@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

  • @cheatingsoftwaresavy
    @cheatingsoftwaresavy 2 роки тому

    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

    • @stingly
      @stingly  2 роки тому

      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 :)

  • @neeshchiiking
    @neeshchiiking 2 роки тому +1

    My question is how do you change the attack depending on the weapon? Sword, Hammer, Staff, Fists

    • @stingly
      @stingly  2 роки тому +3

      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...

    • @cloudmindead5560
      @cloudmindead5560 2 роки тому +1

      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.

    • @neeshchiiking
      @neeshchiiking Рік тому

      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

    • @cloudmindead5560
      @cloudmindead5560 Рік тому

      @@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.

    • @neeshchiiking
      @neeshchiiking Рік тому

      @@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

  • @hamzahichmine7084
    @hamzahichmine7084 10 місяців тому

    Can i ask you. Is that video for people who is beginner cus i didn't get nothing from this one.

  • @MohammedEssamSaleh
    @MohammedEssamSaleh 2 роки тому

    Goood