How to Create ENEMY MOVEMENT in Godot 4

Поделиться
HTML-код
  • Опубликовано: 2 авг 2024
  • Today we cover the creation of a flying enemy’s movement!! I walk you through step by step how to create this type of enemy in your Godot project. This tutorial is part 3 of the Hack’n’Slash series where we cover how to create a Hack’n’Slash game step by step in the Godot 4 game engine! There is so much information in these tutorials so whether this is your first ever Godot game or you are just trying to learn new ways to go about things this tutorial is perfect for you!! If you need help with anything at all then please reach out in the comments!! thanks!! I hope you can learn new knowledge about creating games in Godot! I wish you the best of luck throughout this series!
    Link to Entire Hack’n’Slash Playlist: • Godot Hack'n'Slash Cou...
    Player Art Link: siviovi.itch.io/dacian-warrio...
    Background / Terrain Art Link: zamcham.itch.io/pixel-art-til...
    Bat Enemy Art Link: eduardscarpato.itch.io/bat-an...
    Toxic Frog Enemy Art Link: eduardscarpato.itch.io/toxic-...
    Help Support DevWorm!!! (Patreon): patreon.com/DevWorm
    Chapters:
    0:00 Intro
    0:38 Enemy Scene Setup
    1:30 Enemy Animations
    4:58 Randomized Enemy Movement
    15:24 Player Chase Movement
    20:35 Enemy Only Collisions
    23:49 Tutorial Recap
    Thank you so much for watching, I really hope this video helped.
    if you did enjoy or this video was helpful then all I ask is if you could please subscribe to help out the channel. It means so much and I love your feedback in the comments. I’ll look forward to getting back to you soon! Again thanks so much and I would love to see you again!
    These Tutorials take a lot of time to create and I’m working on becoming a better Teacher and learning how to explain Godot things in a better way, if you’d like to support this journey to expand knowledge and help other game dev’s learn to create their own games then please.. Become a Member! It would mean the world and you’ll help me out so much! Thank you!
    have a great rest of your day and of course be safe :)
    - thanks DevWorm

Комментарии • 62

  • @jeffclark4649
    @jeffclark4649 2 месяца назад +13

    Hey DevWorm, keep doing what you're doing. These tutorials are really helpful and I'm sure I don't speak for myself when I say they are greatly appreciated.

    • @dev-worm
      @dev-worm  2 месяца назад +3

      thank you! it means the world to me! glad they are helpful!

    • @gamingdragon6165
      @gamingdragon6165 2 месяца назад +1

      I agree with this guy. I really cannot wait for the next vid

    • @gamingdragon6165
      @gamingdragon6165 2 месяца назад

      @@dev-worm when will the next vid come though?

    • @wabsastudios
      @wabsastudios 2 месяца назад

      @@dev-worm I always want to make a Pokémon like will you ever make one?please do

  • @MrDapperton
    @MrDapperton 26 дней назад +1

    THIS WAS EXTREMELY EFFING HELPFUL YOU ROCK I LOVE YOU.

    • @dev-worm
      @dev-worm  25 дней назад

      haha so glad i could help!!

  • @buzzbuzz20xx
    @buzzbuzz20xx 2 месяца назад +2

    Awesome !!! glad to see the next part is out

    • @dev-worm
      @dev-worm  2 месяца назад

      thanks!! hope it helps!

  • @JiKayPh
    @JiKayPh 2 месяца назад +1

    Nice! Looking forward to the next vids!

    • @dev-worm
      @dev-worm  2 месяца назад

      thank you!! coming soon!

  • @PollyCot
    @PollyCot 2 месяца назад

    Struggling hard with AI for my game but these give me a shimmer of hope.

  • @htosh3837
    @htosh3837 2 месяца назад +5

    2 +2 = 4 - 1 = 3 quick maths

    • @derDooFi
      @derDooFi 2 месяца назад

      44 long and a 38, too, that’s 82 we’re doing the maths

  • @Pabloparsil
    @Pabloparsil 2 месяца назад +2

    Protip: arrays have a .pick_random method! (I didn't know this but I figured there had to be a function for this).
    Hope it helps!

    • @dev-worm
      @dev-worm  2 месяца назад +2

      ah thanks!! that is super helpful!

  • @sammywn3622
    @sammywn3622 2 месяца назад +1

    Loving your work! Just a suggestion for the bat wander function, rather than adding to its velocity you could use lerp from velocity to a new velocity so that you gradually change between the new velocities but can’t infinitely gain speed in any direction. Code would be something like: lerp (velocity, speed * direction, delta).

    • @dev-worm
      @dev-worm  2 месяца назад +1

      very good point! thank you! this passed right over me! so thank you

  • @Mangalify
    @Mangalify 2 месяца назад +1

    Hey DevWorm, I learned From You To Much! but can you make a tutorial about export game to android 8 in godot 4 becuase i saw a lot of videos and cant do it😢

  • @loyogamestv544
    @loyogamestv544 2 месяца назад +1

    Your explanation is nice. I hope you can explain how the player rides a horse and picks up weapons from the ground😊

    • @Ironpants57
      @Ironpants57 2 месяца назад

      Riding a horse would be a player state or boolean; is_riding:bool. It's much like the weapon equip in an earlier video in the series. You would also need more sprites.

    • @bradleywood1984
      @bradleywood1984 2 месяца назад

      @@Ironpants57 That's right. Personally I would use a state machine for all that since the logic can get a little much but you could just as easily use a single script with a bunch of conditonals.

  • @tnekkGD
    @tnekkGD 2 месяца назад

    awesome tutorial, now I'm just waiting for you to upload the movement of the frog because I'm making a game with the same concept of this and i can't make my own code for the enemy movement, so i need your help... and btw i subbed to your channel

    • @dev-worm
      @dev-worm  2 месяца назад +1

      frog is coming soon!! I'd say around episode 6... so about a week from today!! I hope it ends up being very helpful for your project!!

  • @901oi2
    @901oi2 9 дней назад

    Hey absolutely love the tutorial, tho my script fails to print or move

  • @neptun3189
    @neptun3189 2 месяца назад

    heck yes dude, heck yes

    • @dev-worm
      @dev-worm  2 месяца назад

      hope it helps!! thanks!

  • @itsME-dc4vm
    @itsME-dc4vm 2 месяца назад

    bro is my saviour ;D

    • @dev-worm
      @dev-worm  2 месяца назад

      haha! glad it was helpful!

  • @gaborszafner9662
    @gaborszafner9662 2 месяца назад

    I genuinely feel like you have the most varied topics on Godot 4 on the platform. You have a video for everything. Only if you could talk 20% slower ^^ as a non-native speaker I have to keep going back. But love your videos a lot, really. Thanks for these guides.

    • @dev-worm
      @dev-worm  2 месяца назад +1

      thank you so much!! it truly means the world!! I am sorry about the speaking thing!! I really do apologize and I will take note for the future! but if you ever cant understand something then please just let me know!

    • @StepTheGlow
      @StepTheGlow 2 месяца назад

      broo you can use caption it helps out a ton except when mrbeast talks too much the youtube crash--uhadahdijihia............."THIS COMMENT WAS DELETED BY RUclips"

  • @NocturnalPenguin
    @NocturnalPenguin 2 месяца назад

    You are awesome! Would it be possible to explain the process of how you let the bay access the player’s position? I saw that you had a global script and perhaps I missed it.

    • @bradleywood1984
      @bradleywood1984 2 месяца назад +1

      Basically he made the player body global so that the bat script could use it. You need to go into the player script and initialize the player as self in the ready function. Then, you can call the player's body inside the bat script (or anyone else!) that you need it.

  • @ErenyeagerO_O
    @ErenyeagerO_O 2 месяца назад

    Awesome 👍😎, and finally u still didn't scale Ur editor which makes hard to see what U exactly doing 😂❤❤❤

    • @dev-worm
      @dev-worm  2 месяца назад +1

      so sorry! thanks for reminding me!! I just wrote this down on a sticky-note and Im gonna leave it on my keyboard so I remember! thanks!

  • @weekly_games77
    @weekly_games77 28 дней назад

    hey next time can u make a walking enemy ai without limboa ai

  • @kazmefe6574
    @kazmefe6574 28 дней назад +1

    I get invalid get index position error

  • @stormingelysium1996
    @stormingelysium1996 2 месяца назад

    It made me laugh when we first give our bat movement and mine flew straight up, then suddenly veered off and flew off the side and never came back : p

    • @dev-worm
      @dev-worm  2 месяца назад

      haha did the little bat run away... how did everything come out in the end??

  • @josephbaldwin9472
    @josephbaldwin9472 Месяц назад

    I think i have to start from the beginning of the series cuz as soon as i start trying to do the player chase movement with the global script in my own game the Bat bugs out and just cant move

    • @dev-worm
      @dev-worm  Месяц назад

      really? are you setting all the player related global variables to the correct values in the players script? Im not sure why the bat would be bugging out. Is there anything that seems off from your point of view? any errors or weird output messages or anything?

  • @StepTheGlow
    @StepTheGlow 2 месяца назад

    ah can you help me it's been on my mind lately there's a game named "Swordigo" can you make a "tiny little bit" tutorial on how to make enemy slashing movement because I want similar movement and "enemy beating is fun" experience! thanks for reading!!!

    • @dev-worm
      @dev-worm  2 месяца назад

      Ill start looking into it!! thanks for letting me know!

    • @StepTheGlow
      @StepTheGlow 2 месяца назад

      @@dev-worm thanks buddy!!

  • @justpietro2186
    @justpietro2186 2 месяца назад

    Those enemies also works on top down games right?

    • @dev-worm
      @dev-worm  2 месяца назад +1

      yes of course!! maybe just make the speed a little lower

  • @jasonwilliams8730
    @jasonwilliams8730 2 месяца назад

    👍

  • @ItsnoNoyt
    @ItsnoNoyt 18 дней назад

    where does it come from Global?

  • @sherges44
    @sherges44 15 дней назад

    what does "Identifier "global" not declared in the current scope." mean?

    • @dev-worm
      @dev-worm  14 дней назад

      it means you never declared global as a autoload variable!! maybe you didnt declare one at all or you declared it as Global? We create the autoload earlier in this series i believe!!

    • @sherges44
      @sherges44 14 дней назад

      @@dev-worm sticking with one series is probably better than a bunch of sprawled out tutorials🥲

  • @bleunny
    @bleunny Месяц назад

    Why is Vector2 is not working for me ??

    • @dev-worm
      @dev-worm  Месяц назад

      are you getting any errors?

  • @user-vd6fh5ng3v
    @user-vd6fh5ng3v 2 месяца назад

    what is topic of next video

    • @dev-worm
      @dev-worm  2 месяца назад

      the next tutorial will release in 3 days from now!! It is a huge tutorial and will cover combat!

  • @gryzman
    @gryzman 2 месяца назад

    there's a function that picks random value, pick_random()

    • @dev-worm
      @dev-worm  2 месяца назад

      yes! sorry about that! I could've saved a line of code!! didnt know this was a function! so thanks for letting me know!

  • @tawfitawfik
    @tawfitawfik 2 месяца назад +1

    First comment 🎉🎉🎉

    • @dev-worm
      @dev-worm  2 месяца назад +1

      🎉thanks