2D Enemy AI in Unreal Engine 5 - Beginner Tutorial

Поділитися
Вставка
  • Опубліковано 9 тра 2024
  • Get my 12 hour course on how to make 2D games with Unreal Engine:
    tinyurl.com/Ultimate2D
    Get the free Starter Project to code along:
    / starter-assets-100633993
    In this Unreal Engine 5 tutorial you'll learn how to set up simple Artificial Intelligence for your 2D Enemies.
    Setting up AI in Unreal can be very challenging and this will teach you the basic concepts and also how you can use them with Paper 2D.
    🔔Subscribe: / @cobracode
    Twitter: / cobracodedev
    Discord: / discord
    Timecodes:
    0:00 Intro
    1:06 Making the AI walk forward
    2:25 Adding wall detection
    7:54 Adding ledge detection
    10:38 Using the AI Controller
    🎵 Music By:
    - Team Astro - Hidden Treasure
    - Provided by Lofi Records
    - Watch: • Team Astro - Hidden Tr...
    Icons made by Freepik (www.freepik.com) from Flaticon (www.flaticon.com/)
    #cobracode #gamedev #unrealengine #ue5

КОМЕНТАРІ • 55

  • @CobraCode
    @CobraCode  Місяць тому +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 Місяць тому +3

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

    • @CobraCode
      @CobraCode  Місяць тому

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

  • @nikko590
    @nikko590 29 днів тому +1

    Awesome. Elegant solution really. Thanks for the tutorial!

  • @krolix0274
    @krolix0274 Місяць тому +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!!!

  • @mk-hl5hu
    @mk-hl5hu Місяць тому +2

    Thank you I'll enjoy it

  • @tylergerhart4806
    @tylergerhart4806 Місяць тому +1

    thanks you rock man!

  • @Sadness88
    @Sadness88 Місяць тому +2

    Thanks for this vidéo it's Amazing

  • @ANUBIS_game_dev
    @ANUBIS_game_dev Місяць тому +1

    Thanks i hope you make more

  • @_Garm_
    @_Garm_ Місяць тому +1

    Great tutorial :)

  • @06.almerm.hafidz59
    @06.almerm.hafidz59 Місяць тому +1

    Thank youu for making this tutorial

    • @CobraCode
      @CobraCode  Місяць тому +2

      Thank you for watching :D

  • @jakubgrzybek6181
    @jakubgrzybek6181 Місяць тому +1

    you absolute godsend...

  • @windangeling
    @windangeling Місяць тому +1

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

    • @CobraCode
      @CobraCode  Місяць тому +1

      Hey!
      I already made a complete 10 hour course on a megaman like!
      ua-cam.com/video/xV_uivHM9w0/v-deo.html

  • @user-nx4ur6lc9q
    @user-nx4ur6lc9q Місяць тому +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 !

  • @shataayumohanty7511
    @shataayumohanty7511 Місяць тому

    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  Місяць тому

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

  • @ear4745
    @ear4745 Місяць тому +1

    Nice

  • @tech-boy334
    @tech-boy334 14 днів тому

    Please make a tutorial with behavior trees!!!

  • @Suthriel
    @Suthriel Місяць тому +1

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

    • @CobraCode
      @CobraCode  Місяць тому +1

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

    • @Suthriel
      @Suthriel Місяць тому +1

      @@CobraCode Always learning something new :)

  • @remember_floue
    @remember_floue 27 днів тому

    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?

  • @Hexodroid
    @Hexodroid 21 день тому

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

  • @tylergerhart4806
    @tylergerhart4806 Місяць тому +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  Місяць тому

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

  • @romanchannel69
    @romanchannel69 Місяць тому +1

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

  • @silentasagrenade3801
    @silentasagrenade3801 Місяць тому

    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  Місяць тому +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.

  • @shanliumoshi7904
    @shanliumoshi7904 Місяць тому +1

    This penguin is so cute

  • @thathonestguy-oh9mx
    @thathonestguy-oh9mx Місяць тому +2

    Can you do a tutorial on how to make a game Like otheroworld legends on pc?

    • @CobraCode
      @CobraCode  Місяць тому +1

      Thanks for the suggestion.
      First time I'm hearing about this game, but the art style looks really cool.
      Not quite sure if I'd do something with gameplay similar to this though.

    • @thathonestguy-oh9mx
      @thathonestguy-oh9mx Місяць тому

      @@CobraCode yeah the art and ganeplay mechanics are great esp for a mobile game, if you can't make it do you know someone who i can suggest it to😅

    • @thathonestguy-oh9mx
      @thathonestguy-oh9mx Місяць тому

      ​@@CobraCodebtw what gente of game would you put it as maybe isomteric roguelike 2d?

    • @CobraCode
      @CobraCode  Місяць тому +3

      @@thathonestguy-oh9mx
      You probably shouldn't look for somebody to make exactly your niche type of game.
      All of the tutorials I have will teach you the basics you need and you then have to put it together yourself and make it your own.

    • @thathonestguy-oh9mx
      @thathonestguy-oh9mx Місяць тому +1

      @@CobraCode oh ok thank you so much for replying man🤍

  • @carlosrivadulla8903
    @carlosrivadulla8903 Місяць тому

    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  Місяць тому

      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.

  • @Cactusking1
    @Cactusking1 Місяць тому

    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  Місяць тому

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

  • @skhmusicalstudio
    @skhmusicalstudio Місяць тому

    Can You Make A Tutorial Based Upon The Enemy Needs To Strafe By Detecting The Ledge..
    Also It Should Attack The Player When Enemy Saw The Player
    And The Enemy Should Play His Attack Animation

    • @CobraCode
      @CobraCode  Місяць тому

      Hey, all of those things are covered in my courses.
      Sadly in depth tutorials like that aren't suited for UA-cam.

  • @martimgomes3331
    @martimgomes3331 Місяць тому

    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  Місяць тому

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

  • @coltonkearschner9593
    @coltonkearschner9593 27 днів тому

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

    • @CobraCode
      @CobraCode  25 днів тому

      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 Місяць тому

    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  Місяць тому +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.

  • @brandonbustos7404
    @brandonbustos7404 Місяць тому

    My keeps crashing why

  • @Fpmp01
    @Fpmp01 Місяць тому

    i have never had problem with Udemy until i bought your course. not only i had to pay 2 times because there investigation said payment did not reflect on their side, once the extra payment went through they automatically refunded that charge and my course went with it -_- still waiting for Udemy response to either refund other transaction or just my course back.
    ps: dont upload udemy

    • @CobraCode
      @CobraCode  Місяць тому +1

      Sorry to hear about that :(
      I hope it gets worked out.
      For me Udemy has always been great, both as a user and as an instructor, but I have heard some people have issues with it.

    • @Fpmp01
      @Fpmp01 Місяць тому +1

      @@CobraCode I got them back finally after 2 days lol. Btw I have a 2d course idea if you consider it I would love to learn from you. 2player local multiplayer like old days snow bros, contra

    • @CobraCode
      @CobraCode  Місяць тому +1

      @@Fpmp01
      Thanks for the suggestion.
      Yeah there will definitely be some courses or videos featuring local multiplayer.
      Things have changed quite a bit since the last time I did this, so need to put in some research time though.