Godot 2D How To Add Enemy AI

  Рет қаралды 15,318

Benjamin Game Design

Benjamin Game Design

Күн бұрын

Пікірлер
@RaraD23Youtube
@RaraD23Youtube 11 ай бұрын
This video is the best video I found on enemy ai. Every other one has some reference to something they made in a different video. But this one is can be followed no matter how your game is. This tutorial makes simple enemy ai that can have many other things added to it. I'd like to see a more advanced version at a different date but it doesn't matter that much. Thanks for making this video. It has saved me from redoing my script several more times. 👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍
@BenjaminGameDesign
@BenjaminGameDesign 11 ай бұрын
Thanks! This means a lot.
@devmarboy4045
@devmarboy4045 Жыл бұрын
idk why comments say volume is low I can hear just fine. thanks for the tutorial btw
@BenjaminGameDesign
@BenjaminGameDesign Жыл бұрын
I thought so too when editing it, but if they say it's too low, I'll raise it a bit. Thanks for the comment!
@supjay3945
@supjay3945 10 ай бұрын
I thought it was ok on my ear buds. Im usually the one complaining. It could use a few notches turned up I guess.
@savmass
@savmass 6 ай бұрын
Great tutorial. Thank you for being so thorough. I tried to replicate this in 3D but I noticed that even though I had other collisionshape like walls, the enemy seems to clip through them. I'm sure the same would happen if it's 2D as well since it is using the same principles.
@legosanimations4517
@legosanimations4517 11 ай бұрын
Awesome video mate, one thing tho, it must be on my end, but when I interact with the enemy's collision shape (the big circle) with my player it just pushes it away. Advice would be greatly appreciated!
@BenjaminGameDesign
@BenjaminGameDesign 11 ай бұрын
As in, it gets pushed away from it because it collided or because it is running away?
@legosanimations4517
@legosanimations4517 11 ай бұрын
@@BenjaminGameDesign When i enter the collision circle, it doest chase, it just moves away or closer in one direction
@legosanimations4517
@legosanimations4517 11 ай бұрын
depending on which side I enter
@BenjaminGameDesign
@BenjaminGameDesign 11 ай бұрын
Hmm, in my video titled I PARTICIPATED IN A GAME JAM!!! In the description, there is a link to my Twitter. If you could send me a video on there, that would be great.
@legosanimations4517
@legosanimations4517 11 ай бұрын
@@BenjaminGameDesign I don't use twitter myself, do you happen to have a discord? Or should I make an account there?
@istemann
@istemann Жыл бұрын
The volume is low, but thanks for the guide!
@BenjaminGameDesign
@BenjaminGameDesign Жыл бұрын
Sorry about the audio, but I'm glad you liked the guide.
@SaucinStudio
@SaucinStudio 2 ай бұрын
wow fantastic!!!!! it worked exactly as it did in your video a million thanks!!!
@PringlesA
@PringlesA Жыл бұрын
Awesome video, man! I can hear you well, unlike some comments might suggest. I do have a question, is there any way to stop the enemy from "floating" and going through ground to catch you?
@BenjaminGameDesign
@BenjaminGameDesign Жыл бұрын
I'm unsure what you mean. If you are having problems with collisions, you should look at the collision layers and masks.
@PringlesA
@PringlesA Жыл бұрын
@BenjaminGameDesign I think I fixed it, actually, but I really appreciate your incredibly fast response!
@BenjaminGameDesign
@BenjaminGameDesign Жыл бұрын
Do you mind commenting how incase other people have the same issue.
@bulbachu1327
@bulbachu1327 8 ай бұрын
Hi! I’m having the same problem. How did you fix it?
@minx-fractor
@minx-fractor 8 ай бұрын
@@PringlesA how did u fix pls tell us
@bodie5383
@bodie5383 13 күн бұрын
my enemy freezes in random places, even areas without collision. like my enemy follows the player until it randomly stops, almost like there is invisible barrier preventing it from moving closer
@SethRuh
@SethRuh 7 ай бұрын
i deeply appreciate this video my man
@BrandonTheOverthinker
@BrandonTheOverthinker 5 ай бұрын
I spent over an hour trying to sort out an enemy ai from a tutorial that wasn't even how I wanted it to be. This worked first try and suits my needs so thank you.
@callisto-games
@callisto-games 8 ай бұрын
How do I add wall collisions to the enemy so it doesn't just fly through the walls?
@space.d.
@space.d. 8 ай бұрын
project settings - 2d physics layers name the layers depending on the entities or object of collision - layer 1: player, layer 2: enemy, layer 3: walls etc. - click inside the enemy scene -> characterbody2d if chosen, go to inspector -> collision -> click the layers as you need -> in that case layer 2 = enemy (hover over it and you can see it, as you named it in the settings accordingly) -> mask equals what it can and cannot collide with - choose mask 3 as its named walls now and if the enemy and the walls have a collision2d node attached as child, the enemy will collide with the walls and should not travel through infinity :)
@lay2BH
@lay2BH 4 ай бұрын
Could you help with having the enemy call the function Flip() if the player's direction is equal to -1? Thank you for any help or tips.
@Acey4k
@Acey4k 5 ай бұрын
how would i change this up if it was for a platformer game? It chases me into the air on a platformer game
@hsjwvs
@hsjwvs Жыл бұрын
please make more videos like these
@antii4475
@antii4475 8 ай бұрын
in case of fellow idiots, for enemy collision add the move and slide to their code.
@minx-fractor
@minx-fractor 8 ай бұрын
the enemy is cliiping through floor what should I do?
@bleunny
@bleunny 5 ай бұрын
@@minx-fractor you should do colliders search for Other vidéos 👌🏾
@VanshSingh-p2c
@VanshSingh-p2c 9 ай бұрын
Bro it does not works for me please help
@R2robot
@R2robot 4 күн бұрын
Super low volume.. Even with my ear buds in, I have to turn it up to 8 or 9/10.. and then get blasted by system notifications. Ouch!
@ghostgaimin47
@ghostgaimin47 5 ай бұрын
idk if its my bad pc or if they changed something in the last update but i cant find the DetectionArea node, is there any other way of doing the player detection part?
@danielkelly-hj1wm
@danielkelly-hj1wm 5 ай бұрын
Just called Area2D but I think he renamed it
@ghostgaimin47
@ghostgaimin47 5 ай бұрын
@@danielkelly-hj1wm already found out lol, thx anyways
@bleunny
@bleunny 10 ай бұрын
Man for me the ennemy is trying to go away from me bro 😢 why ??
@starbind
@starbind 10 ай бұрын
mine too, did u fix it?
@McnoogyWoogy_III
@McnoogyWoogy_III 9 ай бұрын
have u fixed it my man? I am in dire need of assistance
@bleunny
@bleunny 9 ай бұрын
@@McnoogyWoogy_III no i did not bro 😟 i need some support man
@McnoogyWoogy_III
@McnoogyWoogy_III 9 ай бұрын
@@bleunny noooo 😭
@MrGre3do
@MrGre3do 9 ай бұрын
You must've messed up some + and - somewhere
@necrotafeio
@necrotafeio 2 ай бұрын
not working, enemy wont move
@OceaniaAirline
@OceaniaAirline 10 күн бұрын
Mine flys away from me :/
@walterallred
@walterallred 11 ай бұрын
I was able to follow the tutorial with the audio muted so not sur why everyone tripping on the audio. I got this working but I'm not a huge fan of the enemy motion. If it's following me and I stop it gradually gets slower and slower until it's directly on top of the player.
@BenjaminGameDesign
@BenjaminGameDesign 11 ай бұрын
That's a weird issue. I never encountered this. If you manage to fix this, please comment how so others can see.
@user-rr1ly
@user-rr1ly 3 ай бұрын
same did you fix it?
@Ghostpants446
@Ghostpants446 5 ай бұрын
Thank you. this was good
@revoxhr
@revoxhr 9 ай бұрын
How add physical to enemy
@kholikmaulana529
@kholikmaulana529 11 ай бұрын
Thank You 😊
@TheFrostWalker
@TheFrostWalker 8 ай бұрын
THANKS ! god bless you!
@muhammadnuralhafiz
@muhammadnuralhafiz Жыл бұрын
Oh yes
@kholikmaulana529
@kholikmaulana529 11 ай бұрын
Thank You
@612Luck
@612Luck 10 ай бұрын
Nice!
@shaunmcmanus2418
@shaunmcmanus2418 Жыл бұрын
First
@HalVerArt
@HalVerArt 7 ай бұрын
heya I hope u still answer to the comments but I cant seem to make my enemy move at all, even though I followed everything specified in the video... could I contact you via discord?
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4,3 МЛН
Every 2D Node Explained in 9 Minutes !
9:19
Lukky
Рет қаралды 395 М.
Their Boat Engine Fell Off
0:13
Newsflare
Рет қаралды 15 МЛН
I Sent a Subscriber to Disneyland
0:27
MrBeast
Рет қаралды 104 МЛН
We made Vampire Survivors BUT in 10 Lines of Code
7:08
PlayWithFurcifer
Рет қаралды 1 МЛН
Can You Beat Minecraft From One Grass Block?
35:27
Beppo
Рет қаралды 6 МЛН
How Do Game Devs NOT Overscope??
9:04
Green Light Dev
Рет қаралды 12 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 783 М.
Godot Scripts I add to Every Game
12:34
Aarimous
Рет қаралды 64 М.
Creating SMART enemies from scratch! | Devlog
5:40
Challacade
Рет қаралды 379 М.
Godot 2D How To Add Collision Between Objects
9:18
Benjamin Game Design
Рет қаралды 440
Официально стал АЛХИМИКОМ - Potion Craft
15:26
Obsidian Time
Рет қаралды 1,6 МЛН
What size should your assets be? | HD 2D GAME ART
12:10
Nonsensical 2D
Рет қаралды 152 М.
Their Boat Engine Fell Off
0:13
Newsflare
Рет қаралды 15 МЛН