Тёмный

Tutorial: How to create melee attacks using AnimatedSprite! (Godot Engine 3.2) 

AntiDev, Godot Engine Tutorials & Analysis
Подписаться 2 тыс.
Просмотров 56 тыс.
50% 1

Sorry for taking too long.
Also, the video from KidsCanCode:
• Godot Recipes: Melee A...
Music:
0:00 Resistance - Mega Man Zero OST
1:00 Grape Garden - Kirby Super Star OST
Outro Music: "Super Mario World Game Over LoFi Hip Hop Remix" by Phillip "Hephestos" Schlosser( / hephestosmusic )

Опубликовано:

 

15 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 243   
@antidevgodot
@antidevgodot 4 года назад
One small detail: For people having problems flipping their collisions to the left side, you can try using: if Input.is_action_pressed("right"): get_node("AttackArea").set_scale(Vector2(1, 1)) elif Input.is_action_pressed("left"): get_node("AttackArea").set_scale(Vector2(-1, 1)) Hope it helps, sorry for the trouble!
@itachiuzumaki5553
@itachiuzumaki5553 4 года назад
thanks, + 1 subscribe
@alliumcepa857
@alliumcepa857 4 года назад
this doesnt work? i put in my code and activated collision view but the attack area stays on the right edit: it only kind of works for me. it doesnt flip when i turn around but rather when i attack and then move. so if i want the collision to flip, i have to be holding the right or left key before the attack animation finishes. edit 2: i finally got it to work! i had it under my animation finished function so it did not work properly. thank you!
@antidevgodot
@antidevgodot 4 года назад
alliumCepa Glad it worked!
@evohollywood303
@evohollywood303 3 года назад
I wanna add jump attack Help 😔
@benperrin1612
@benperrin1612 3 года назад
Hi, when I put this in my script it did flip the collision to the left side but it pushes the left side collision too far away in the x axis from the player meaning there is a large space between the player sprite and the collision. Any help would be much appreciated :)
@evertoncardoso7471
@evertoncardoso7471 4 года назад
I finally found a person who teaches well. Thank you very much, helped me a lot
@antidevgodot
@antidevgodot 4 года назад
Everton Cardoso I really really really appreciate your kind words! Stay tuned for more! :DD thanks a lot for passing by!
@actionninja6389
@actionninja6389 3 года назад
pal, i was about to give just up because i couldnt figure out how to make a animation finish without keeping the input just pressed. the answers i found where gross you just saved the day. thank you alot i wish you the best bro
@scottpetrovic
@scottpetrovic 2 года назад
This is perfect. I was wanting to do something simpler not needing the animation player...and this is the type of solution I had in mind!
@user-uo4vs2qx9j
@user-uo4vs2qx9j 10 месяцев назад
Your enemy attack tutorial is very perfect, I was looking for it a lot and I couldn't find it, thanks! greetings from Argentina 🇦🇷🇦🇷
@vipervlame
@vipervlame 3 года назад
Thank you for this tutorial, I have been messing 3 days with the animation not playing correctly. Thanks to you I have finally fixed it.
@antidevgodot
@antidevgodot 3 года назад
I'm glad you could fix it and that I could help!!
@ikiri2735
@ikiri2735 4 года назад
thanks bro I was looking for this a long time THANK YOU
@antidevgodot
@antidevgodot 4 года назад
Ikiri Glad I could help! :DDD
@New_Gaming_Chair
@New_Gaming_Chair 2 года назад
Great Godot content. Helped me so much thanks :)
@aque9608
@aque9608 5 месяцев назад
I've been looking for this for HOURS! Nobody else could explain to me how to do it, and finally you did. Thank you! Now my frog can croak without messing the animations.
@CallMeDrumz
@CallMeDrumz 2 дня назад
Hey could you help my character geta stuck and i did the same thing as mentioned in the video but doesnt work
@aque9608
@aque9608 2 дня назад
@@CallMeDrumz I no longer have any idea what this was even about, let alone how to help you with zero details. Asking on Reddit may help you more
@benperrin1612
@benperrin1612 3 года назад
Thank you for this tutorial your teaching is so clear! Helped me figure out why my animation wouldn’t play correctly
@hiruymetsihafe8997
@hiruymetsihafe8997 2 года назад
true
@pipinpierard
@pipinpierard 2 года назад
I search for revolving my trouble with animation for days !! you save me thanks ! great viedo
@ervinfarhan9549
@ervinfarhan9549 4 года назад
This is a very very good tutorial! Thank you so much! Please upload more videos 😁👍
@antidevgodot
@antidevgodot 4 года назад
Ervin Farhan I really appreciate it!! I will, I promise! :D
@saeedsalem8535
@saeedsalem8535 4 года назад
best one who explained attacks in godot thanks
@ccicoding764
@ccicoding764 3 года назад
I almost never leave comments, but just wanted to stop and say, you are amazing at teaching, you solved my problem. Thanks a lot.
@antidevgodot
@antidevgodot 3 года назад
Thank you so much!!! I really appreciate it! Good luck in your Godot path!!
@zackcool6080
@zackcool6080 2 года назад
It helped a lot thanks and God bless you,it was really amazing and simple but you kinda took a long time to explain 😄 anyway thanks again
@Christopher-ty2gc
@Christopher-ty2gc 2 года назад
hi there .I realise you haven't made any videos for over a year. but i just want to say how much I appreciate your videos and that without them i could never have progressed with my own game this far. i hope one day you will return to make more content but i realise everyone is busy these days. i wish you the best and hope you return . thank you so much for your videos!
@fireblo33om
@fireblo33om 2 года назад
Very well explained video, thank you!
@iPePod
@iPePod 3 года назад
Thank you very much! I was losing my mind, trying to figure out how to do this
@EtchGamer
@EtchGamer 3 года назад
I work on my game project in godot and .... You are my saviour I really appreciate you .... all my greatings to you from egypt
@antidevgodot
@antidevgodot 3 года назад
Thanks for the kinds comments my man :) good luck with your Godot projects, greetings from Germany!
@lexflow2319
@lexflow2319 3 года назад
Dope video hommie
@MegaAbhirox
@MegaAbhirox 3 года назад
thanks buddy it was very simple to follow and very clear :)
@antidevgodot
@antidevgodot 3 года назад
Thank you so much! I hope it helped!
@postano9153
@postano9153 4 года назад
dude i love you so much, ive been stuck on this stupid thing for like 10 hours, i can't thank you enough
@antidevgodot
@antidevgodot 4 года назад
I'm glad your problem was solved! Good luck with your game :D
@akosifords
@akosifords 4 года назад
Thanks I was stuck in this part. Great tutorial
@antidevgodot
@antidevgodot 4 года назад
Mark Anthony Fordan I'm glad it helped, thanks for watching!! :D
@paologeovanny6176
@paologeovanny6176 4 года назад
Awesome tutorial!
@antidevgodot
@antidevgodot 4 года назад
thank you so much! :D
@thedevine3756
@thedevine3756 4 года назад
Awesome tutorial, you are a great teacher :) you deserve WAY more then 500 subs, but I am one of those subs! 👍
@antidevgodot
@antidevgodot 4 года назад
The Devine Thank you so much!!! I really appreciate it. I'm glad I helped. :)
@antidevgodot
@antidevgodot 4 года назад
Ahh!! Didn't see the rest of your comment, thank you so much for subscribing and for your kind words! :DD
@kikosa1349
@kikosa1349 4 года назад
you saved my life... i was thinking of leaving the idea of making my own game because of this..thank you sooo much
@antidevgodot
@antidevgodot 4 года назад
Glad I could help! :D
@tictoktrending7184
@tictoktrending7184 4 года назад
Thanks for your great contents
@znomad8026
@znomad8026 4 года назад
Thank you !! Great tut !!!
@antidevgodot
@antidevgodot 4 года назад
Thank you for your words!! :D
@sirbootylord6880
@sirbootylord6880 Год назад
Thanks you sir, This is what I was looking for
@demioni1561
@demioni1561 4 года назад
You're amazing. helped me a lot thanks!!
@antidevgodot
@antidevgodot 4 года назад
Demioni Thank you so much for the kind words!!! I'm glad I helped :D
@pranksies4496
@pranksies4496 4 года назад
thank you a lot, very simple and to the point!!
@antidevgodot
@antidevgodot 4 года назад
Thanks!!!
@adr1an29
@adr1an29 2 года назад
Thx for this simple good video 🙏
@kaoslinkcabana
@kaoslinkcabana 3 года назад
Amigo amo este video, mil gracias, me has ayudado mucho ☺️☺️☺️☺️☺️
@AxZelAnimations30
@AxZelAnimations30 9 месяцев назад
This is is basically what I used to do back in Unity and it's almost the same in Godot which is a good thing.
@KanishkaDilshan
@KanishkaDilshan 4 года назад
Nice tutorial
@antidevgodot
@antidevgodot 4 года назад
Thanks!
@antidevgodot
@antidevgodot 4 года назад
You can skip the intro at 1:00 :)
@fabricioaf89
@fabricioaf89 9 месяцев назад
I think the animation player is very complicated, and also, i wasn't wanting to redo everything i had done, so thank you so much for this tutorial, I'll try it as soon as possible
@princessbitch96
@princessbitch96 4 месяца назад
I just learned how to do the grid function on GIMP and it makes things way easier. If youset the grid to 16 x 16 then use a 32 x 32 (or similar dimension) you have a cross down the middle so you can line the sprites up.
@lmlstudio2008
@lmlstudio2008 3 года назад
what a life saver!
@sonikrocket7881
@sonikrocket7881 2 года назад
This tutorial is amazing! I want to add an attack 2, attack3 . All separate keys but I've already used the animation finished and signals how would I go about adding more attacks to this script? I've tried doing this tutorial multiple times for each attack but I can't get it to work. Cud u do a further tutorial for this? Thanks
@fabricioaf89
@fabricioaf89 9 месяцев назад
Because i didn't know how to turn the Area2D in the other direction, i created a copy of the area on the other side of my sprite, and added the same code using the name of the copy(CollisionShape2D and CollisionShape2D2), it worked 😅
@carlostanner5453
@carlostanner5453 3 года назад
This is a great video! Can you do a video if where you were top rpg with all 8 directions?
@jormungandtv5512
@jormungandtv5512 2 года назад
I love your chanel, ths for help
@brianwindson9656
@brianwindson9656 3 года назад
very good video man, I'm glad you use animatedsprite because most things are just animation player and I think it's kinda a time waste
@antidevgodot
@antidevgodot 3 года назад
Thank you! Haha, yeah, tell me about it. When I used to search through Godot tutorials all of them used AnimationPlayer too, so I wanted to give a bit of aid to the ones who used AnimatedSprite like I do :D
@rounak3811
@rounak3811 3 года назад
Thanks man
@VaSoapman
@VaSoapman 3 года назад
I feel like I have WAY more control over what is actually happening with Animated Sprite. Sure the animation player can do a lot more. It can alter pretty much any number from a node. Problem is if something breaks with that I will have NO IDEA what broke or how to fix it. With the Animated sprite I can just bypass using the .play() function entirely if I want too. Because I can tell Godot what frame and animation to play. Its awesome.
@olegmostepan5960
@olegmostepan5960 3 года назад
Thank you, great tutorial :) that what I was thinking about, how to use animated sprite with mlea attack :)
@lonewolfprogrammer8932
@lonewolfprogrammer8932 3 месяца назад
Thanks alot!!!
@Sr.Haruno
@Sr.Haruno Год назад
this doesn't seem to work well with the Combo system if using an state machine only the first hit works, I have no idea how make each hit count
@lolipopjojo6218
@lolipopjojo6218 3 года назад
Thx 🙏 understood how to am gonna script my player in few minutes
@xxmundoetcxxetc5185
@xxmundoetcxxetc5185 4 года назад
HELLO: 3, how could I do what you do but with another movement system than yours: c I don't know what to do mine is like this func _physics_process (delta): control S () movement() spritedirection_loop () damage_loop () if moverirection! = Vector2 (0,0): anim_switch ("walk") plus: anim_switch ("inactive") function controls (): LEFT var = Input.is_action_pressed ("ui_left") RIGHT var = Input.is_action_pressed ("ui_right") var UP = Input.is_action_pressed ("ui_up") var DOWN = Input.is_action_pressed ("ui_down") movedirection.x = -int (LEFT) + int (RIGHT) movedirection.y = -int (UP) + int (DOWN) Should I erase everything and do it like you do? the truth if I delete mine tends to do many things that are outside the attacks Help please I'm stuck here
@davidgames0016
@davidgames0016 3 года назад
Muito bom ótima aula!!
@antidevgodot
@antidevgodot 3 года назад
Obrigado!!
@beanfox6454
@beanfox6454 2 года назад
Very 👌
@urbansongbirds8386
@urbansongbirds8386 3 года назад
Very great video!! It helped me a lot but there are two main Problems I have. I can't flip the side of the collision shape (even not with the tips in the comments or with the command "$Attackarea/collisionshape2d.flip_h = true/false") I'm also havin issues with attacking while jumping. in that case my layer gets stuck in jumping animation and I have to click attack to walk again. I would be very happy if you could make a second part of this video where you explain how to improve the script with jumping and change attack side.
@w.e.a.k.9768
@w.e.a.k.9768 3 года назад
Thank You Sir ^_^
@colddeath9797
@colddeath9797 3 года назад
Thank you for the tutorial! Is there a way to make dynamic collision for attacks? Like it was in Weaponlord: sword is moving during animation => collision rect changes for every frame.
@jeanmakesgames
@jeanmakesgames 2 года назад
Yes you can do that with the animation player, you just need to key the position of the collision shape for that :)
@PrivateBooth
@PrivateBooth 4 года назад
Oh I had no idea I was steam friends with a somewhat-popular youtuber. Sweet!
@evohollywood303
@evohollywood303 3 года назад
I hope your channel grows alottttttt ilyyyy More tutorials pls Can you make tutorials on enemy ai and boss levels Like If I enter the boss stage Entrance and exit closes it shouldn't open till I beat the boss plssssss
@gargoyled_drake
@gargoyled_drake 2 года назад
kinda wish i found this a little earlier 😅i have the longest setup for animations, since i had issue with the attack and idle animation being called at the same time and with the same if statements, countering eachother. gonna try this one next time, looks, a lot more simple and easy on the eyes when looking through the script
@gargoyled_drake
@gargoyled_drake 2 года назад
nevermind, switched to this method now, it's way easier to handle without a statemachine setup
@I_Stern
@I_Stern 2 года назад
ok....very nice and so on lol.....but how do you attack while running ?
@lilrs9595
@lilrs9595 3 года назад
So I ran into a problem with this: Basically, I had to explicitly set the attack area's collision shape to be enabled ($attackarea/CollisionShape2d.disabled = false) in the if statement for when the attack button is pressed in order to get it to work. It would stay enabled if I didn't do that. Other than that, there were a few bumps in the road I ran into, but I managed to fix it before I wrote this comment. It was really messing with my head that I couldn't get the attack animation to play entirely, but then I realized I forgot the if statement. I also couldn't get the signal for an area entering the enemy to work until I realized my collision layers/masks weren't set properly (I had them set differently from the default because I had some code already in my particular enemy to make it also "die" when you jump on its head) I'm mentioning this here in case anyone else runs into the same problems I did. Everything else about this tutorial is spot on!
@kartikeysharma5304
@kartikeysharma5304 2 года назад
Great Tutorial. But I'm facing a problem now, the player character is passing through the enemy and their Collison is not being detected, only the attack in the sword area. Any idea about this ?
@asyria216
@asyria216 Год назад
it's been a year but check your layers and make sure that the player is different from world / enemy
@thelastronin7277
@thelastronin7277 Год назад
What if I want to activate the collison later? is it possible? for my attacking animation I need to activate it on the 5th frame.
@Ifrit_desu
@Ifrit_desu 4 года назад
So I have a problem... I don't know if anyone has run into this but. When I try to set up the death animation it stops the enemy from dying.
@Asbjornn
@Asbjornn 3 года назад
I have a problem, when my character turns to the left, his position changes and moves away from the Collisionshape a bit, the same happens with the attack animation, can someone help me?
@aerutus4720
@aerutus4720 3 года назад
What megaman series is that you using one of the Weil guardian ?
@team_legends1683
@team_legends1683 2 года назад
thnx
@maximilianoortigoza9841
@maximilianoortigoza9841 3 года назад
How do I make it also attack the left activating a collision on the left and without activating the right?
@razsiadam2454
@razsiadam2454 3 года назад
Hello, dear Dev! Your tutorial is brilliant, and I have one question! So, when I press jump and after the press enter, what is my attack button, my little hero starts to play the fall animation when he's on the ground. After I press enter again, it jump to the idle animation, so this is a really little bug, but it's here. :))) What can I do against that?
@ozanbolulu9971
@ozanbolulu9971 3 года назад
same error. did you solve it?
@ShineOrSomething
@ShineOrSomething 3 года назад
same error me 2 did u solve it. :(
@Sr.Haruno
@Sr.Haruno Год назад
Guys, try state machines. It solved alot.
@69Bruhmoney69
@69Bruhmoney69 3 года назад
how do I make it so if my player hits again after he hit once it will change his hitting animation.
@xerogaming2127
@xerogaming2127 3 года назад
what condition should i put to flip animation of attack acc to direction in which player is facing ?
@bryanonce5024
@bryanonce5024 3 года назад
Guys what if I using AnimationPlayer,6:31 what I will change in code animation ?
@DennisKwasnycia
@DennisKwasnycia 4 года назад
Please help. What method would you use to flip_h the AttackArea(area2d) when the parent flip_h. Otherwise, when my sprite turns to face the opposite direction, the area2d collision is behind it. It seems the area2d does not have a flip_h, so how would you fix this?
@gonzitarod2885
@gonzitarod2885 3 года назад
How can I do that if my animated_sprite of the player is flip_h, the globalposition of the area = the left player?
@Blue-Scorpion
@Blue-Scorpion 2 года назад
how to talk and attack in same time? is that doable with animated sprite node?
@markflakezCG
@markflakezCG 4 года назад
If anyone wants too to attack while running just type "if isAttacking == false:" before playing the run animation. like so if isAttacking == false: $AnimatedSprite.flip_h = true $AnimatedSprite.play("Run")
@ibi662
@ibi662 2 года назад
hi need help i cant see collision shape 2d in area 2d
@sully8495
@sully8495 3 года назад
how do you make it face the other way the attackarea collisionshape
@epicswordgaming
@epicswordgaming 3 года назад
can you show us how you coded the jump slash?
@TheRealKaiProton
@TheRealKaiProton 4 года назад
This was great, and I spent like 10mins trying to figure out why mine errored every time, until I realised get_node is case sensitive, DOH! My Question however, how to I get the Attack Area to enable at a certain sprite frame ?
@TheRealKaiProton
@TheRealKaiProton 4 года назад
Never mind, Google is my Friend; I added frame_changed signal, and in the function had is isAttack and Frame == x then enable AttackArea.
@Jorge_super
@Jorge_super 2 года назад
Can i make the AttackArea change with every frame of the attack?
@davidhurtado7134
@davidhurtado7134 4 года назад
weiter so crack
@antidevgodot
@antidevgodot 4 года назад
david hurtado Dankeschön, Kumpel
@Migraman2
@Migraman2 4 года назад
Hi, great video! I'm trying to do a fighting game so I need to use the hitbox on an exact frame. I need the hitbox to show only on frame 2 of an attack, for example. Can you help me, please? Thank you!
@antidevgodot
@antidevgodot 4 года назад
Oh yes, my next tutorial will be about that! You need to use a function called "match" and the signal, "frame_changed()" in AnimatedSprite and apply them to your code :D
@Migraman2
@Migraman2 4 года назад
@@antidevgodot Thank you so much for the quick response =). I spent my day trying to do this and failing. Even tried using the animation player, but I don't have spritesheets to work! I will wait your next video to continue this part. For now, I will focus on something else. Thank you again!
@antidevgodot
@antidevgodot 4 года назад
Kaio Tavares No need to thank me! Expect it very soon!🥳🥳
@mladennikolic4394
@mladennikolic4394 3 года назад
my player freezes when attack anim is finished.. signals not working extends KinematicBody2D const UP = Vector2(0,-1) const GRAVITY = 12 const MAXFALLSPEED = 200 const MAXSPEED = 100 const ACCEL = 10 const JUMPSPEED = 200 var motion = Vector2() var facing_right = true var isAttacking = false func _ready(): pass func _physics_process(delta): motion.y += GRAVITY if motion.y > MAXFALLSPEED: motion.y = MAXFALLSPEED if facing_right == true: $Sprite.scale.x = 1 else: $Sprite.scale.x = -1 motion.x = clamp(motion.x,-MAXSPEED,MAXSPEED) if Input.is_action_pressed("right") && isAttacking == false: motion.x += ACCEL facing_right = true $AnimationPlayer.play("Run") elif Input.is_action_pressed("left") && isAttacking == false: motion.x -= ACCEL facing_right = false $AnimationPlayer.play("Run") else: motion.x = lerp(motion.x,0,0.2) if isAttacking == false: $AnimationPlayer.play("Idle") if Input.is_action_just_pressed("attack"): $AnimationPlayer.play("Attack") isAttacking = true if is_on_floor(): if Input.is_action_just_pressed("jump"): motion.y -= JUMPSPEED if Input.is_action_just_pressed("attack"): $AnimationPlayer.play("Attack") if !is_on_floor(): if motion.y < 0: $AnimationPlayer.play("Jump") elif motion.y > 0: $AnimationPlayer.play("Fall") motion = move_and_slide(motion, UP) func _on_AnimationPlayer_animation_finished(anim_name): if $AnimationPlayer.current_animation == "Attack": isAttacking = false THIS IS MY CODE
@gabrielebianca1268
@gabrielebianca1268 4 года назад
How set-up collisionshape2d in 4 direction?
@sechmascm
@sechmascm 3 года назад
If you have attack animations for each direction, add a key to the first frame of the transform rotation value of the collission shape based on which direction you're facing. So that when that animation plays it'll rotate the shape accordingly.
@shenzai
@shenzai 4 года назад
OK, This is what I'm looking for.
@antidevgodot
@antidevgodot 4 года назад
Shenzai Hope it helps!
@shenzai
@shenzai 4 года назад
@@antidevgodot Thanks but all saber sprites aren't same. I need different collisions to others.
@antidevgodot
@antidevgodot 4 года назад
Shenzai Ah, I understand. You are working with AnimatedSprite, right?
@shenzai
@shenzai 4 года назад
@@antidevgodot No, I prefer AnimationPlayer for my project. But what is the variation?
@antidevgodot
@antidevgodot 4 года назад
Shenzai Ah! In that case, you should check KidsCanCode's video, he works with AnimationPlayer and he shows different sized-collisions on his vid :D
@HiroyukiVfx
@HiroyukiVfx Год назад
hello i am having a problem when i press x it dosent show the animation and i even assinged the attack to x can u plz give me the code thank u and can u give the mega man assets plzzz
@toxicray4698
@toxicray4698 3 года назад
how do i get the little guy im new?
@zazackstickman5983
@zazackstickman5983 4 месяца назад
the movement= move_and_slide line is showing error that only 0 arguments are allowed but recieved 2
@balaboss78
@balaboss78 2 месяца назад
If you use Godot 4 Just write "move_and_slide()"
@danobra
@danobra 4 года назад
How does one make a walking attack?
@zonkrt3463
@zonkrt3463 4 года назад
I was having a problem where I would push the button and the first frame of my attack animation would play before my character locked up. Some testing saw that isAttacking was returning 'true', so the input was being received properly. Here's how I solved it: func get_input(): movement = Vector2() if Input.is_action_pressed("left") and isAttacking == false: movement.x = -speed $Sprite.play("walk") elif Input.is_action_pressed("right") and isAttacking == false: movement.x = speed $Sprite.play("walk") else: if isAttacking == true: pass else: movement.x = 0 $Sprite.play("idle") This is my movement code. If left or right are pressed, walking animations are played (making a fighting game so don't need to flip sprites yet). The change I made was on what happens otherwise. I added an additional conditional that checks if isAttacking is returning true, and passes if it is. Otherwise, it plays "idle". This extra level of prevention for the return to the idle animation was enough to solve the problem. The comments on this question paired well with AntiDev's advice in helping solve the problem: godotengine.org/qa/53696/the-attack-animation-doesnt-finish-help-me
@antidevgodot
@antidevgodot 4 года назад
Hey! Are you sure that there isn't any animation "overwriting" the other? It's common for two animations to play at the same time by mistake, resulting in one of the two not playing.
@zonkrt3463
@zonkrt3463 4 года назад
@@antidevgodot Thanks for the prompt reply on a week old video, means a lot. Solved it, edited original response for visibility.
@evohollywood303
@evohollywood303 3 года назад
Thanks
@swordsdragon
@swordsdragon 3 года назад
My slash animation is looping.
@blenderer3191
@blenderer3191 3 года назад
hm, this doesn't seem to be a good solution since your area is open as long the animation is playing, which means another object can get hit multiple times.
@SenatorBrotein
@SenatorBrotein 3 года назад
What is the difference between putting == instead of =???
@antidevgodot
@antidevgodot 3 года назад
== is always needed in "if" statements. "=" and "==" don't mean the same in programming. = is "Program, make this equal to this" == is "Program, if this is equal to this..." I hope I've explained it well. "==" is always used in conditions. Not only in GDscript, but in every (modern) language, I think.
@darkconage2867
@darkconage2867 4 года назад
When i pressed the attack and the jump button in the same time, it stucks on the jump animation Uhh how to fix it? Thanks
@gonzitarod2885
@gonzitarod2885 3 года назад
you must put if Input.is_action_pressed("ui_up")&& is_atack == false:
@darkconage2867
@darkconage2867 3 года назад
@@gonzitarod2885 ohh thanks!
@ShineOrSomething
@ShineOrSomething 3 года назад
hi same thing happened to me but GonzitaRod's solution doesnt work for me
@kaoslinkcabana
@kaoslinkcabana 3 года назад
amigo ahora que cuando brinque pueda golpear y no se detenga
@danny3xeer
@danny3xeer 8 месяцев назад
omg mmz and mmzx mentioned
@alexandraP7475
@alexandraP7475 4 года назад
Thanks for your tutorials is very very good and helpful but my enemy is a kenematicBody2D so how I can do the same but with this type of element ?
@antidevgodot
@antidevgodot 4 года назад
Thanks a lot! And that's a good question. Personally I've never used KinematicBody2D for an enemy, but you could try using the signal "on_body_entered() instead of "on_Area_entered()" that could help.
@alexandraP7475
@alexandraP7475 4 года назад
@@antidevgodot I don't know why but I don't have this node. So, I added an area2D as a child of the kinematicBody and a collisionShape2D as a child of the area and the collision is a copy of the collision of the kinematicBody. It seems to work. Thanks for your answer
@antidevgodot
@antidevgodot 4 года назад
Alexandra Pietri ah! That actually makes a lot of sense. I always tend to forget that you can use both! I'm happy that it worked, and good luck with your project!
@razsiadam2454
@razsiadam2454 3 года назад
Hello devs! :D Well, I tried to solve this problem, but when I create an area 2d like a child of KinematicBody2D, it has problem with my character move's code. But when I don't use Area2D, there's no problem. How can my enemy move when it's Area2D? I can kill enemy, but it can't walk, and that's unfair. :D
@HechiPunK
@HechiPunK 3 года назад
I need help, the animation after writing the code and testing it, when I type the attack key instead of stopping it continues, and I no longer have it pressed, what do I do?
@cloudeiii
@cloudeiii 4 месяца назад
its on loop
@anamendez1970
@anamendez1970 4 года назад
Hi! How do I make it so when the character is turned to the left, the collision box changes it's position?
@antidevgodot
@antidevgodot 4 года назад
Pikku Cocoa if you have a line of code that says: "$AnimatedSprite.flip_h = true" when the character moves left, do the same with the Area2D that holds the collision for the sword. :)
@anamendez1970
@anamendez1970 4 года назад
@@antidevgodot Thanks for the answer! Your videos are really helpful :D But it gives me the error: Invalid set index 'flip_h' (on base: 'Area2D') with value of type 'bool'.
@antidevgodot
@antidevgodot 4 года назад
Pikku Cocoa Thanks for the feedback! And give me a sec, I'll go into my own project to check out a solution.
@antidevgodot
@antidevgodot 4 года назад
@@anamendez1970 Hello again! You were right. It indeed gives an error back. Try something like: if Input.is_action_pressed("right"): get_node("AttackArea").set_scale(Vector2(1, 1)) elif Input.is_action_pressed("left"): get_node("AttackArea").set_scale(Vector2(-1, 1)) Hope it helps!
@anamendez1970
@anamendez1970 4 года назад
@@antidevgodot It worked, thank you so much!
@gilbraltar8857
@gilbraltar8857 4 года назад
Hi can you make tutorial about enemy following player, attacking player, and make the player die if you make this, this would be soo much helpful!! i like your video btw
@tubagusthariqgilbraltar7499
@tubagusthariqgilbraltar7499 4 года назад
YES THAT WOULD BE AMAZING
@antidevgodot
@antidevgodot 4 года назад
Thanks for liking it! I guess I could work on that. :)
@tubagusthariqgilbraltar7499
@tubagusthariqgilbraltar7499 4 года назад
@@antidevgodot YESSSS THANK YOUU SOO MUCHH
Далее
10+2 AWESOME ADDONS for GODOT 4
8:36
Просмотров 129 тыс.
Дьявол - ТРЕШ ОБЗОР на фильм
19:10
[RU] Winline EPIC Standoff 2 Major | LAN | Final Day
9:48:47
I Made the Same Game in 8 Engines
12:34
Просмотров 3,9 млн
Godot Recipes: Animation States
10:31
Просмотров 105 тыс.
INSANELY Smooth pixel ATTACK Animation Tutorial
18:54
Просмотров 543 тыс.
Immersive Sim in Godot 4: COGITO - Overview
8:22
Просмотров 35 тыс.
13 ADDONS to SPEED UP your game creation in GODOT!
11:23
I programmed Minecraft from scratch... again.
11:44
Просмотров 569 тыс.
How Games Make VFX (Demonstrated in Godot 4)
5:46
Просмотров 323 тыс.
choosing a game engine is easy, actually
15:08
Просмотров 337 тыс.
Using Composition to Make More Scalable Games in Godot
10:13