Тёмный

Enemy AI: Aiming And Shooting - Godot Tutorial AI Series Pt 2 

Garbaj
Подписаться 461 тыс.
Просмотров 32 тыс.
50% 1

-- Social --
Discord: the discord server has been shut down, sorry!
Twitter: / garbaj2
-- Links --
Github: github.com/GarbajYT
-- About --
In part 2 of our Godot enemy AI series, we'll be learning how to make our enemies aim and shoot.

Игры

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

 

26 июл 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 119   
@Gredran
@Gredran Год назад
The deeper I get into Godot, the more intuitive I learn everything actually truly is. State machines are always daunting for me to setup but not only is your tutorial amazing, but I’m realizing how simple it is to pick it all up in Godot. Thanks for these!
@yukmsacierzorro
@yukmsacierzorro 4 года назад
Very elegant and intuitive solution, and great explanation. Your channel in general is such a good source for learning Godot.
@garbaj
@garbaj 4 года назад
Appreciate it. Glad you found the video helpful!
@Ash21
@Ash21 Год назад
I would love to see these tutorials continue, the way you showcase and explain things is very helpful for a beginner, I've found that other tutorials don't really explain things as well as you do.
@abdulbasitado6180
@abdulbasitado6180 4 года назад
Amazing tutorials as always. It's good to see how your channel has grown.
@garbaj
@garbaj 4 года назад
Thanks for the support :)
@disdis6127
@disdis6127 3 года назад
Thank you for making such great videos. Please make more on AI
@gdmattartz3071
@gdmattartz3071 4 года назад
Thanks for the Enemy AI! i modified it so the enemy can shoot me and made it difficult to kill. thanks !
@garbaj
@garbaj 4 года назад
Nice, glad to see people building on my tutorials
@KevinCodes
@KevinCodes 4 года назад
very cool tutorial, not currently working on a fps atm but i enjoyed regardless & will keep this vid in mind if/when i do!
@garbaj
@garbaj 4 года назад
Awesome, thanks for watching
@jetiscander
@jetiscander 4 года назад
When will you release the next part? it is very useful and interesting
@diariodeumdesenvolvedor
@diariodeumdesenvolvedor 3 года назад
Man you helped me a lot! Thank you so much!!
@nightcode3171
@nightcode3171 4 года назад
Again, this is very simple and very Helpful. Thankyou for the tutorial.
@garbaj
@garbaj 4 года назад
You're welcome!
@nightcode3171
@nightcode3171 4 года назад
I also thought of making 2 states with ur tutorial with 2 range detectors for AI ADS (accurate) and HIP (with spread) if the player is very near the AI.
@garbaj
@garbaj 4 года назад
Nice, glad you're experimenting with your own ideas, I wish everyone did this!
@brayansaldana3496
@brayansaldana3496 Год назад
can you upload another part I'm learning a lot with you tutorials, and thanks. 😁 nobody teach this like you does.
@saaamoth
@saaamoth 4 года назад
These videos are so cool
@ishkapoor7931
@ishkapoor7931 4 года назад
this was really helpful. thankyou so much
@garbaj
@garbaj 4 года назад
You're welcome!
@severno1903
@severno1903 3 года назад
you are a good teacher
@Wodsobe
@Wodsobe 4 года назад
This was a pretty epic tutorial!
@garbaj
@garbaj 4 года назад
Thanks, glad to see you back btw
@Wodsobe
@Wodsobe 4 года назад
@@garbaj thanks!
@scorder8555
@scorder8555 3 года назад
Love your tutorials but at 7:45 deg2rad actually coverts degrees to radians (hence "deg" to "rad") which mathematically is a much better option for the engine.
@frankoesavage8314
@frankoesavage8314 4 года назад
Wow I was really impressed with this, As i tried something simular watching your way will be a easier merge because how simular it is
@frankoesavage8314
@frankoesavage8314 4 года назад
Holy shit I can finally say Im a Game Dev
@garbaj
@garbaj 4 года назад
Aren't simple solutions great? Always Glad to help
@frankoesavage8314
@frankoesavage8314 4 года назад
It is pretty simple, requires alot of reading however, and its not like code is like opening up a book. Starting to feel like it though hahaha
@frankoesavage8314
@frankoesavage8314 4 года назад
Hell yeah! , Now sheit is gonna start getting interesting
@garbaj
@garbaj 4 года назад
oh yeah
@frankoesavage8314
@frankoesavage8314 4 года назад
@@garbaj And i Shall start watching now lol
@DrNabeel20
@DrNabeel20 4 года назад
amazing! thank you ☺️🤩
@garbaj
@garbaj 4 года назад
You’re welcome 😊
@nuralimedeu
@nuralimedeu 4 года назад
Yay!
@codingkam1252
@codingkam1252 4 года назад
4:29 another way of doing it is if body.name== "Player": state = alert
@garbaj
@garbaj 4 года назад
Oh yeah, I forgot about that! Very useful
@jetiscander
@jetiscander 4 года назад
You can have a lot of players (for i.e. multiplayer game or different characters at singleplayer) with different names
@BigDaddyWes
@BigDaddyWes 3 года назад
Doing it by group is way more versatile, but there's always more than one way to program depending on your needs.
@cmds.learning7426
@cmds.learning7426 4 года назад
really helpful!!!!
@garbaj
@garbaj 4 года назад
Glad you think so!
@g0ldhat55
@g0ldhat55 3 года назад
Can you do a tutorial on how to spawn bullet lines for raycast weapons so that like weapons look like they are shooting bullets :>
@sloungy
@sloungy 2 года назад
Can you do a next part where you show us how to make the enemy deal damage to use
@ziggleboy1309
@ziggleboy1309 2 года назад
✋🖐️🖐️I followed your tutorials fully. My Enemy is rotating again and again in player direction.🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃 How can I stop them.
@Mentleif
@Mentleif 4 года назад
Will you cover how to have an enemy navigate an environment? I've been wanted to implement moving enemies in a game, but I'm at a complete loss as to how to have them patrol areas and chase the player around obstructions
@garbaj
@garbaj 4 года назад
I've been messing around with pathfinding but I haven't got it working yet. Here's a tutorial though I haven't gotten it to work yet ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-_urHlep2P84.html
@762
@762 2 года назад
Next part please!!!
@judelightning242
@judelightning242 2 года назад
i had a problem where ALERT in match state is coming up as a syntax and i have prepped everything right anyone know what could be causing this
@pmlpvdlte2801
@pmlpvdlte2801 4 года назад
Tnx a lot for all these valuable tips. I need a code for 2d game * If we touch the enemy sprite with our finger (playing in mobile) or on mouse click, then it will vanish (with animation). * Enemy sprites appearing randomly in different places. * Total count showing in the top right screen. Tnx
@tridra5714
@tridra5714 3 года назад
More Please
@bity-bite
@bity-bite 4 года назад
Yes like
@itn0es159
@itn0es159 4 года назад
saw your comment on noob hunter's vid
@garbaj
@garbaj 4 года назад
Didn't expect it to get so many likes lol
@tubagusthariqgilbraltar7499
@tubagusthariqgilbraltar7499 4 года назад
Hey Garbaj i want ask, What's the use of a polygon collision? I am completely new to Godot btw
@garbaj
@garbaj 4 года назад
It lets you create a custom collision shape if something like a cube or a capsule isn't good enough
@tubagusthariqgilbraltar7499
@tubagusthariqgilbraltar7499 4 года назад
@@garbaj YES FINALYY SOMEONE THATS SIMPLE TO UNDERSTAND like your vid btw
@alphisticgamer3799
@alphisticgamer3799 3 года назад
hi bro i want a tutorial on enemy patrol, chase, and attack in 3d, hope you help me with this please!!.
@user-mz6eq8oi5t
@user-mz6eq8oi5t 2 года назад
Do next part please
@seraph8293
@seraph8293 2 года назад
For me the script worked fine but I added a bhoppping script to my character but when I bhop around the enemy and stop the enemy is shooting to the side of the player and missing
@slappa7377
@slappa7377 3 года назад
Release part 3 please mate
@ismaelsilveira2316
@ismaelsilveira2316 4 года назад
Hey man, when i wrote the aiming script, i tested the game, and the enemy aimed... but at the opposite direction! XD how can i solve this problem? english isn't my first language so sorry in advance. Great video as always. Thanks
@garbaj
@garbaj 4 года назад
Maybe you added the character mesh backwards?
@ismaelsilveira2316
@ismaelsilveira2316 4 года назад
@@garbaj No, because the raycast also turns to the opposite side. By the way, thanks for replying quickly
@ismaelsilveira2316
@ismaelsilveira2316 4 года назад
@@garbaj Actually, i kinda solved the problem. I rotated the RayCast and the mesh in 180 degrees, so now the enemy faces the player. Thanks, man.
@FederxDev
@FederxDev 6 месяцев назад
have you ever updated this tutorial for godot 4?
@gdmattartz3071
@gdmattartz3071 4 года назад
i have some very idk problem. i did everything but instead of the enemy looking at me it looks the opposite side. how to fix this?
@garbaj
@garbaj 4 года назад
You probably added the character model backwards
@disdis6127
@disdis6127 3 года назад
Hi, I found your channel today so, therefore you are seeing so many comments of mine 😅
@garbaj
@garbaj 3 года назад
Welcome to the channel!
@jamingchannel3021
@jamingchannel3021 3 года назад
when i run the game and go into the enemies range, it looks away from me and then follows me but its not looking at me
@garbaj
@garbaj 3 года назад
The mesh isn't facing forward. In the enemy scene, turn the mesh around 180 degrees
@achillesgaming8569
@achillesgaming8569 3 года назад
still no working for me even if I turn it Help!!!!!!
@gankstabuilder660
@gankstabuilder660 3 года назад
@@garbaj thank you so much it worked like a charm!
@itsfela
@itsfela 4 года назад
More about AI please! Maybe a behaviour tree style IA? I found this gdscript.com/godot-behaviour-tree but i'm still unable to connect the states with my character, getting a lot of errors :(
@madcap7772
@madcap7772 3 года назад
Pls make a tutorial so that the enemy can shoot us
@jaxamus13
@jaxamus13 3 года назад
What happened to the series I was rlly relying on it
@garbaj
@garbaj 3 года назад
There will be more, but there are other videos I'd like to make as well. Luckily if you've watched all 3 of my AI videos you should be able to make most things with a little bit of creativity
@xxdarkking368xx5
@xxdarkking368xx5 2 года назад
Im having a problem when the enemy AI turns to me it looks 180 degrees away so the exact oposite position how do I fix this?
@Ceisriel
@Ceisriel Год назад
having the same problem, did you fix it?
@carlsonraywithers3368
@carlsonraywithers3368 Год назад
​@@Ceisrielrotate ur mesh to 180
@P0150Ngmod
@P0150Ngmod 3 года назад
the enemy looks at me with his back lol, how do i fix this?
@garbaj
@garbaj 3 года назад
rotate the enemy mesh instance node 180 degrees
@P0150Ngmod
@P0150Ngmod 3 года назад
@@garbaj thanks!
@zagame4real609
@zagame4real609 3 года назад
part 3?
@garbaj
@garbaj 3 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-YFgrpp1fpOI.html
@root4098
@root4098 3 года назад
when I do this the enemy looks in the OPPOSITE direction of the player (i.e, the enemy will turn their back to the player) how do I fix this?
@garbaj
@garbaj 3 года назад
flip the meshinstance around 180 degrees
@root4098
@root4098 3 года назад
@@garbaj not simple to do that because of how the camera is currently setup. would require camera rewrite
@garbaj
@garbaj 3 года назад
Better rip the bandaid off and get it done now otherwise it's just going to cause more problems in the future
@JOEDEV-no5cb
@JOEDEV-no5cb Год назад
rotate_y(- deg2rad(eyes.rotation.y * turnspeed)) easy
@doomknight233
@doomknight233 3 года назад
The enemy AI looks away from me. Anyone know a fix?
@daxtonzimmerman3091
@daxtonzimmerman3091 Год назад
try rotating your mesh 180 degrees.
@pyrosoup4413
@pyrosoup4413 11 месяцев назад
Don't use this video if you're using godot 4, many changes just gonna cause a headache
@rmt3589
@rmt3589 6 месяцев назад
What if I use this method without using Godot at all! Bwahahahahahahahshshsha
@thedigitalwolf6932
@thedigitalwolf6932 Год назад
hi, ik this is 2 years later and u prob won't respond, but can anyone tell me why it's not working for me? I tested it and the exact part that isn't working is the : if raycast.is_colliding(): any idea of why anyone?
@daxtonzimmerman3091
@daxtonzimmerman3091 Год назад
make sure you have the variable raycast or it will not work
@chedev
@chedev Год назад
and make sure you have collision shape in the enemy
@disdis6127
@disdis6127 3 года назад
Will you please make video on coding AI's thirst,hubger,water finding and food finding in Godot
@hshsjsjsj506
@hshsjsjsj506 4 года назад
someone help why my enemy is facing in the opposite direction when player is entering the collision shape? :(
@hshsjsjsj506
@hshsjsjsj506 4 года назад
update i already solve the issue haha
@root4098
@root4098 3 года назад
@@hshsjsjsj506 how did you solve this?
@old_pepe
@old_pepe 3 месяца назад
player is ugly
@cloud_and_proud
@cloud_and_proud 3 года назад
When I try and run this in my game, and I enter into the enemy's range, they begin spazzing out. D: I can't figure out what's causing this, please help.
@denizdemir9255
@denizdemir9255 4 года назад
Can you make the enemy shoot projectiles?
@garbaj
@garbaj 4 года назад
Yes it's very easy. Watch my projectile weapon tutorial to get some ideas on how to do it ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-IDsoEAj5xG0.html
@denizdemir9255
@denizdemir9255 4 года назад
@@garbaj I got the enemy to shoot projectiles, but I am having trouble making the enemy actually look at the player. I've tried so, so many things and now my code is a whole mess. I'm sure there is a really quick way to do it, but nothing seems to work.
@achillesgaming8569
@achillesgaming8569 3 года назад
how to enable and disable raycasts
@garbaj
@garbaj 3 года назад
name_of_raycast.enabled = true
@achillesgaming8569
@achillesgaming8569 3 года назад
@@garbaj thx you are my hero
@achillesgaming8569
@achillesgaming8569 3 года назад
I put if Input.is_action_pressed("weapon") aimcast.enabled = false and it does not work
@achillesgaming8569
@achillesgaming8569 3 года назад
What to put
@mrtwan105
@mrtwan105 4 года назад
can you do a grapple rope and a crosshair tutorial?
@nightcode3171
@nightcode3171 4 года назад
2nd
@Ceisriel
@Ceisriel Год назад
i swear the more tutorials of yours i watch the mor I get trust issues with people, like pretty much every single tutorial of yours resulted in errors in glitches
@Ceisriel
@Ceisriel Год назад
after a day i realized that this method is flawed to begin with, using areas for player detection leads to an incredible loss of performance, with this method, 20 enemies in a scene and the game lags incredibly barely reaching 10 fps, but I've tested projects with different player detection and they can run 100 enemies at minimum 20 fps.
@naxusv7232
@naxusv7232 4 месяца назад
which player detection works best??
@possiblyzslot838
@possiblyzslot838 15 дней назад
You should back up this claim by identifying the aforementioned method, no?
@editz_king6473
@editz_king6473 Месяц назад
Hallo dein Tutorial gefällt mir nicht!!
Далее
Enemy AI Series 1: The State Machine
12:10
Просмотров 50 тыс.
Базовый iPhone 16
00:38
Просмотров 377 тыс.
БАТЯ И ТЁЩА😂#shorts
00:58
Просмотров 2,1 млн
Wait for the BOWLING BALL! 👀
00:38
Просмотров 14 млн
Complete 3D Shooting Mechanics - Godot 4 FPS Tutorial
12:14
This is one of my favorite video game exploits
3:27
Просмотров 244 тыс.
8 DEVS Make a GAME without COMMUNICATING!
13:21
Просмотров 977 тыс.
Remaking My First Godot Game - Devlog 0
8:48
Просмотров 3,2 тыс.
Weapon Switching In Godot - FPS Tutorial
14:41
Просмотров 33 тыс.
When The UI Is More Than Just A PNG
3:39
Просмотров 189 тыс.
Godot 4 - Tiled Dungeon Environment From Scratch
26:24
Просмотров 397 тыс.
Learning Unreal Engine in One Month to make a Game!
15:25