Pros: Conceise To the point Time line laid out so you can skip to what you want Cons: ---------- A perfect tutorial in all aspects, no time wasted and the only time you spent rambling still had purpose.
Here's how you fix the animation interrupts You will need animationtree or enum state machine(better with animationtree but i don't used it before so i will explain it with enum) You will need to make state "attack" in enum. Example: enum state {idle, Walk, jump, attack} and this for your attack code: if Input.is_action_just_pressed("Light attack") && player_state == state.attack: pass elif Input.is_action_just_pressed("Light attack"): $AnimationPlayer.play("attack 1") player_state = state.attack idle = false So if an attack animation is playing, another attack animation can't be played until current one is finished. Make sure to turn state.attack back to idle after attack animation finished playing. And for other animations like walk, jump, etc, you can do the same. Hope this helped
Nice tutorial :) here is another way it could be done: var attacks = ['Saber1','Saber2','Saber3'] var currentAttack = 0 func _process(delta): if Input.is_action_just_pressed(x): $AttackReset.start() $ZeroSprite.play(attacks[currentAttack]) currentAttack ++ if currentAttack > attacks.length: currentAttack = 0 movement = move_and_slide(movement, up) func _on_AttackReset_timeout(): currentAttack = 0
@@Jeansou21 Yep! I tested it out :) worked great! That line basically means, if the currentAttack number is bigger then the number of attacks in the attacks array.
You can skip the intro by fast-forwarding to 0:52 If you only want the code, go to 2:00 or 15:15 for the in-tutorial version. If you want to skip to the "theory part" of the tutorial, go to 2:38 If you only want to know how to "Slap-it-into-Godot!" go to 4:20 Hope you like this video or find it useful.
Is there a way to make it wait until the animation has finished? I'd like each slash to start and stop before moving onto the next, as is you can just rapidly press the attack button and it skips through each animation.
What about implementing a timer, after so long with idle input you can't continue with the timers? Every attack action pressed adds to the timer by a fraction of a second so it does't fall off so quickly?
Hola , recien encuentro tu canal! estaba buscando tutoriales asi desde hace un tiempo, lo que no he podido encontrar es un tutorial en godot para poder hacer que el player en cuestion pueda esquivar ataques enemigos o el tipico parry de los soul's like o hack and slash , me gustaria ver en un futuro una implementacion con estas ideas en godot! Saludos , me suscribo :v
Muchas gracias por suscribirte :D Hmmm. Hace mucho que no tiempo ningún souls. Lo último que jugué fue Demon Souls. Pero con decir "parry" me imagino algo como Street Fighter Third Strike. ¿Tienes algún vídeo de referencia?
@@antidevgodot Si! algo parecido a la famosa jugada del Daigo Parry en el Evo 2004, o algun tipo de mecanica de evadir y esquivar pero enfocado al 2d, un ejemplo en 3d podria ser las mecanicas del Godhand de ps2 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-hgzYBNGEXdM.html ! :D
@@jesustzinon Creo que ya pensé en una forma en la cual podrían implementarse las mecánicas. Más que todo el parry, el parry suena fácil. Sin embargo, a pesar de que programar mecánicas de esquivar suena relativamente fácil, hay que hacer animaciones muy acordes a lo que se está haciendo en pantalla. Por lo que tendría que buscar algún personaje con sprites de esquivar. (Aunque puedo pensar en algo como el "dodge" de Videl en Dragon Ball Fighterz) ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-FP3KXdImI3M.html o en el dodge de Smash. (A pesar de que sean juegos 3D emulando una vista 2D)
Why cant i set my animatedsprite to $AnimatedSprite.play? Did they change the name of the command that is used to play the animated sprite? Edit: Nevermind im stupid and forgot to add the kinematicbody2d :p Thank you very much for this
Great base, but still alot of code, I would move the Anim names into an array, then the attackpoints be array.size()-1 and start at 0, then each press calls the anim by array number, then the array number +=1, for the return, have each attack press, set a bool to True, then in the anim end signal, if bool == true then set back to idle, this would also allow for the timer to be plugged in,
@@shenzai Well, since you have a falling line of code, that could interfere with the jumpslash animation. (Happened to me before) The cool thing of Godot 3.1 is the finite state machine, that gives you a better idea of the animations that are playing.
Hahahah well, to be honest the community from r/Godot is really friendly and hungry for tutorials! They helped me a lot to gain subs. Sadly I moved to Germany some days ago, and haven't been able to use my computer. I have a lot of videos planned for later, though! Thanks for stopping by ;D