2D Enemy AI in Unreal Engine 5 - Beginner Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ม.ค. 2025

ความคิดเห็น • 67

  • @CobraCode
    @CobraCode  9 หลายเดือนก่อน +1

    Get the free Starter Project to code along:
    www.patreon.com/posts/starter-assets-100633993
    Get my 12 hour course on how to make 2D games with Unreal Engine:
    tinyurl.com/Ultimate2D

  • @lukoppotamas7888
    @lukoppotamas7888 9 หลายเดือนก่อน +5

    lets go! I was asking for this in your 2d series intro video. Thanks man!

    • @CobraCode
      @CobraCode  9 หลายเดือนก่อน

      :D
      Thanks for the suggestion.
      Viewers asking about it was what pushed me to finally cover this!

  • @krolix0274
    @krolix0274 9 หลายเดือนก่อน +1

    Fantastic tutorial. I bought one of your courses and I'd love to see how to make a simple bossfight. Hope you make more!!!

    • @CobraCode
      @CobraCode  9 หลายเดือนก่อน

      Thank you :D

  • @nikko590
    @nikko590 8 หลายเดือนก่อน +1

    Awesome. Elegant solution really. Thanks for the tutorial!

  • @NeedABigrHammer
    @NeedABigrHammer 5 หลายเดือนก่อน +1

    Absolutely love your videos! It’s made me focus almost entirely on 2d and 2.5d now in UE5 and it’s so fun. It would be amazing if you could make a tutorial on top-down enemy ai/combat next

    • @CobraCode
      @CobraCode  5 หลายเดือนก่อน +1

      Thank you :D
      Actually working on a full course about Top Down 2D in Unreal right now.
      There's gonna be a section making a zelda-like with top down combat.

  • @mk-hl5hu
    @mk-hl5hu 9 หลายเดือนก่อน +2

    Thank you I'll enjoy it

  • @jephrennaicker4584
    @jephrennaicker4584 7 หลายเดือนก่อน +1

    Great work! hope to see more 2D Enemy AI

  • @nox_pff6710
    @nox_pff6710 3 หลายเดือนก่อน +1

    This was super useful, thank you!

  • @PatrickDettmann-f9t
    @PatrickDettmann-f9t 9 หลายเดือนก่อน +1

    I really enjoy your content, thank you for the work.
    I Only have one thing that I feel is not perfect.
    It`s always heavy to understand for a newbie, when you start with this is a class from this and from that and so it is.
    Maybe it comes more handy with a note like:"if this is unclear check here" or even "Check my course online"
    Ill try to use this video in my first project, maybe it works for me, maybe not.
    Anyway, again:
    Thank You !

  • @dislue
    @dislue 8 หลายเดือนก่อน +1

    Could you please make a video of how to make a player respawn after a flipbook plays when the player dies like Mario game and a UI with some phrases pops up for a few seconds?

  • @BallinVlogs
    @BallinVlogs 28 วันที่ผ่านมา

    DUDE YOU ARE GENIUS

  • @windangeling
    @windangeling 9 หลายเดือนก่อน +1

    Nice tutorial. If there will be series for a metrovania or megaman like games that will be sweet!

    • @CobraCode
      @CobraCode  9 หลายเดือนก่อน +1

      Hey!
      I already made a complete 10 hour course on a megaman like!
      th-cam.com/video/xV_uivHM9w0/w-d-xo.html

  • @Hexodroid
    @Hexodroid 8 หลายเดือนก่อน

    5:59 yeah guys you can just skip allat and just do add 180 to actor rotation, not SET... ADD

  • @phildrakep2953
    @phildrakep2953 7 หลายเดือนก่อน +1

    Hello, Could you help me to make a 2d rope That we can go up and down and swing. THANKS

  • @Sadness88
    @Sadness88 9 หลายเดือนก่อน +2

    Thanks for this vidéo it's Amazing

  • @Suthriel
    @Suthriel 9 หลายเดือนก่อน +1

    Thats cool, i didn´t know about that "validated get" option o.O

    • @CobraCode
      @CobraCode  9 หลายเดือนก่อน +1

      Not quite sure when exactly that was added, but came out in one of the UE 5 updates!

    • @Suthriel
      @Suthriel 9 หลายเดือนก่อน +1

      @@CobraCode Always learning something new :)

  • @_Garm_
    @_Garm_ 9 หลายเดือนก่อน +1

    Great tutorial :)

  • @lukeloadman
    @lukeloadman 2 หลายเดือนก่อน

    Can you tell us how to add I frames

  • @ANUBIS_game_dev
    @ANUBIS_game_dev 9 หลายเดือนก่อน +1

    Thanks i hope you make more

  • @jakubgrzybek6181
    @jakubgrzybek6181 9 หลายเดือนก่อน +1

    you absolute godsend...

  • @ronberry5314
    @ronberry5314 7 หลายเดือนก่อน +2

    Is there anyway to just move the enemy back and forth (simple patrol) without bumping into something?

    • @CobraCode
      @CobraCode  7 หลายเดือนก่อน

      Yeah, that way you'd want to use something like a waypoint or a distance to walk.
      You'll have to set the coordinates to where you want to walk and then on tick (or in a timer) check if you've reached that point and then turn around.

    • @Exponerad
      @Exponerad 5 หลายเดือนก่อน

      You could also do it using a spline.

  • @06.almerm.hafidz59
    @06.almerm.hafidz59 9 หลายเดือนก่อน +1

    Thank youu for making this tutorial

    • @CobraCode
      @CobraCode  9 หลายเดือนก่อน +1

      Thank you for watching :D

  • @tylergerhart4806
    @tylergerhart4806 9 หลายเดือนก่อน +1

    thanks you rock man!

  • @tylergerhart4806
    @tylergerhart4806 9 หลายเดือนก่อน +1

    I just bought your 12 hour lesson. I know what im doing this weekend. Is there a way to make a character section screen? Thanks you rock

    • @CobraCode
      @CobraCode  9 หลายเดือนก่อน

      Thank you :D
      Sadly Menus and UI are a big topic to cover, so they're not included in the course

  • @tech-boy334
    @tech-boy334 8 หลายเดือนก่อน

    Please make a tutorial with behavior trees!!!

  • @carlosrivadulla8903
    @carlosrivadulla8903 9 หลายเดือนก่อน

    isn't a bit overkill casting in AiController to get the char and performing an is valid on tick for every enemy in the game?

    • @CobraCode
      @CobraCode  9 หลายเดือนก่อน

      We have a similar setup in a VR shooter that has 50+ enemies at once and there aren't issues with it.
      You could find ways to optimize it through interfaces and other things.

  • @shataayumohanty7511
    @shataayumohanty7511 9 หลายเดือนก่อน

    Really like the vid .can you make a video on enemy AI having ranged attacks , sensing player location and following them to attack and a simple health system

    • @CobraCode
      @CobraCode  9 หลายเดือนก่อน

      Hey, all of that is covered in my courses, sadly TH-cam doesn't respond well to highly specified tutorials like that.

  • @matteocamboni3572
    @matteocamboni3572 3 หลายเดือนก่อน

    Is it possible to make the movement not only on one axis, but on all three? Thank you in advance for your response

    • @CobraCode
      @CobraCode  3 หลายเดือนก่อน +1

      Hey, it's possible, but it makes things much more complicated.
      When moving on 2 axes you'll usually use a nav mesh, however for 3 axes you'll want something called '6dof'.
      There is no built in solution for this in unreal or most game engines, however you can probably find a plugin on the marketplace or some open source project.

  • @silentasagrenade3801
    @silentasagrenade3801 9 หลายเดือนก่อน

    If you were doing like a 3D/2D project with this is there a simple way to make the enemy sprite face the player camera after it turns?

    • @CobraCode
      @CobraCode  9 หลายเดือนก่อน +1

      You could look into 'billboarding' and adding that to the material to force the sprite to always face towards the camera, no matter what.

  • @DennisTorres-bu3ni
    @DennisTorres-bu3ni 7 หลายเดือนก่อน

    Hello, good afternoon, sorry for the inconvenience, I have a question and I hope to find an answer, I am starting my independent Arcade game, however there are details that I want for my game that I have not found in any tutorial, and my question is the following, if you allow me to use Donkey Kong from 1981 as an example, it is a video game in which it is important to see every detail, especially the falling barrels, or like Pac-Man 1980, I want the camera to be able to see the entire scenario like the examples mentioned, without connecting the camera to the petdonaje, how can I do that in unreal 5?

  • @shanliumoshi7904
    @shanliumoshi7904 9 หลายเดือนก่อน +1

    This penguin is so cute

  • @Cactusking1
    @Cactusking1 9 หลายเดือนก่อน

    New to Unreal but this This Video helped me a lot, but if I want to add so when my player collides with my enemy my player dies, how to I do that?

    • @CobraCode
      @CobraCode  8 หลายเดือนก่อน

      Hey, you can try looking into OnBeginOverlap and collision channels, that should point you in the right direction.

  • @shnicelskiy
    @shnicelskiy 2 หลายเดือนก่อน

    Hello, the link to the course is not available, how can I get it?

    • @CobraCode
      @CobraCode  2 หลายเดือนก่อน

      Does the TinyUrl not lead you anywhere?
      In that case here's a direct link
      www.udemy.com/course/unreal-2d-course/?couponCode=A8ADB4E99AA1B7363046

  • @romanchannel69
    @romanchannel69 9 หลายเดือนก่อน +2

    That's way simpler than my Event Tick -> Sphere Trace

  • @coltonkearschner9593
    @coltonkearschner9593 8 หลายเดือนก่อน

    Can somethi g like this easily be edited to work with a top down 2d game?

    • @CobraCode
      @CobraCode  8 หลายเดือนก่อน

      You'd have to make some adjustments to account for the additional dimension, but yeah you could use a similar system

  • @pager_official
    @pager_official 9 หลายเดือนก่อน

    Man how to stop camera when character is near to the wall in closed room? 2D character in 3D world. I need this because camera shows wall's outside view

    • @CobraCode
      @CobraCode  9 หลายเดือนก่อน +1

      You'll have to create some box collision that will zoom the camera in when entering a room or give the walls a special material that you can then make seethrough when the character enters.

  • @KondixOfficial
    @KondixOfficial 5 หลายเดือนก่อน

    Where to get this Penguin sprite? Please show me

    • @CobraCode
      @CobraCode  5 หลายเดือนก่อน

      Hey, it's a part of this free asset pack
      essssam.itch.io/rocky-roads

    • @KondixOfficial
      @KondixOfficial 5 หลายเดือนก่อน +1

      @@CobraCode thank you!

    • @KondixOfficial
      @KondixOfficial 5 หลายเดือนก่อน

      ​@@CobraCode Hello!
      I need your help again. How can i fix the textures? Because when i build the game the textures will be blurry and bad. Can u help me fix it?

    • @CobraCode
      @CobraCode  5 หลายเดือนก่อน

      @@KondixOfficial Make sure the 'filter' on all textures is set to 'Nearest' and NOT 'Default (From Texture Group)'
      This looks fine in the editor, but for some reason not in a build

    • @KondixOfficial
      @KondixOfficial 5 หลายเดือนก่อน

      @@CobraCode Thank you! I will try!

  • @nocturne87
    @nocturne87 27 วันที่ผ่านมา

    will this method work for 2.5D?

    • @CobraCode
      @CobraCode  26 วันที่ผ่านมา

      Yeah it's all the same in terms of collisions and game logic

  • @martimgomes3331
    @martimgomes3331 9 หลายเดือนก่อน

    hi! I have a question, I did a 2d enemy in a 3d world, but when the enemy dies, the dead sprite it's not in the ground, is floating a bit, do you know how to fix it?

    • @CobraCode
      @CobraCode  9 หลายเดือนก่อน

      Hey, might be a problem with how your sprite sheet is set up and where the pivot points are.

  • @ear4745
    @ear4745 9 หลายเดือนก่อน +1

    Nice

  • @brandonbustos7404
    @brandonbustos7404 9 หลายเดือนก่อน

    My keeps crashing why

  • @SwonkyDonkey
    @SwonkyDonkey 7 หลายเดือนก่อน

    Hi, I have followed your tutorials for melee combat and this one. How could I use the enemy to be able to get hit by the player with the logic from the melee combat video? I have already tried to use the same health system for the enemy that was used for the player, but it gets one shotted even though It should not... How could I fix this?