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

  Рет қаралды 33,273

Garbaj

Garbaj

Күн бұрын

Пікірлер: 120
@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!
@Gredran
@Gredran 2 жыл бұрын
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!
@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 :)
@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
@disdis6127
@disdis6127 3 жыл бұрын
Thank you for making such great videos. Please make more on AI
@jetiscander
@jetiscander 4 жыл бұрын
When will you release the next part? it is very useful and interesting
@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
@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.
@brayansaldana3496
@brayansaldana3496 2 жыл бұрын
can you upload another part I'm learning a lot with you tutorials, and thanks. 😁 nobody teach this like you does.
@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
@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 4 жыл бұрын
Doing it by group is way more versatile, but there's always more than one way to program depending on your needs.
@ziggleboy1309
@ziggleboy1309 3 жыл бұрын
✋🖐️🖐️I followed your tutorials fully. My Enemy is rotating again and again in player direction.🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃 How can I stop them.
@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!
@Wodsobe
@Wodsobe 4 жыл бұрын
This was a pretty epic tutorial!
@garbaj
@garbaj 4 жыл бұрын
Thanks, glad to see you back btw
@Wodsobe
@Wodsobe 4 жыл бұрын
@@garbaj thanks!
@diariodeumdesenvolvedor
@diariodeumdesenvolvedor 3 жыл бұрын
Man you helped me a lot! Thank you so much!!
@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
@severno1903
@severno1903 3 жыл бұрын
you are a good teacher
@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 :>
@nuralimedeu
@nuralimedeu 4 жыл бұрын
Yay!
@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 kzbin.info/www/bejne/labVeZ-bpZeDbpY
@saaamoth
@saaamoth 4 жыл бұрын
These videos are so cool
@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
@ishkapoor7931
@ishkapoor7931 4 жыл бұрын
this was really helpful. thankyou so much
@garbaj
@garbaj 4 жыл бұрын
You're welcome!
@judelightning242
@judelightning242 3 жыл бұрын
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
@762
@762 2 жыл бұрын
Next part please!!!
@sloungy
@sloungy 2 жыл бұрын
Can you do a next part where you show us how to make the enemy deal damage to use
@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
@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.
@DrNabeel20
@DrNabeel20 4 жыл бұрын
amazing! thank you ☺️🤩
@garbaj
@garbaj 4 жыл бұрын
You’re welcome 😊
@pyrosoup4413
@pyrosoup4413 Жыл бұрын
Don't use this video if you're using godot 4, many changes just gonna cause a headache
@rmt3589
@rmt3589 9 ай бұрын
What if I use this method without using Godot at all! Bwahahahahahahahshshsha
@itn0es159
@itn0es159 4 жыл бұрын
saw your comment on noob hunter's vid
@garbaj
@garbaj 4 жыл бұрын
Didn't expect it to get so many likes lol
@alphisticgamer3799
@alphisticgamer3799 4 жыл бұрын
hi bro i want a tutorial on enemy patrol, chase, and attack in 3d, hope you help me with this please!!.
@wash99
@wash99 14 күн бұрын
Let me know if you found something
@jaxamus13
@jaxamus13 4 жыл бұрын
What happened to the series I was rlly relying on it
@garbaj
@garbaj 4 жыл бұрын
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
@jamingchannel3021
@jamingchannel3021 4 жыл бұрын
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 4 жыл бұрын
The mesh isn't facing forward. In the enemy scene, turn the mesh around 180 degrees
@achillesgaming8569
@achillesgaming8569 4 жыл бұрын
still no working for me even if I turn it Help!!!!!!
@gankstabuilder660
@gankstabuilder660 3 жыл бұрын
@@garbaj thank you so much it worked like a charm!
@tridra5714
@tridra5714 4 жыл бұрын
More Please
@FederxDev
@FederxDev 8 ай бұрын
have you ever updated this tutorial for godot 4?
@bity-bite
@bity-bite 4 жыл бұрын
Yes like
@cmds.learning7426
@cmds.learning7426 4 жыл бұрын
really helpful!!!!
@garbaj
@garbaj 4 жыл бұрын
Glad you think so!
@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
@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!
@disdis6127
@disdis6127 3 жыл бұрын
Will you please make video on coding AI's thirst,hubger,water finding and food finding in Godot
@slappa7377
@slappa7377 3 жыл бұрын
Release part 3 please mate
@ОлегЛукин-д5ф
@ОлегЛукин-д5ф 2 жыл бұрын
Do next part please
@cloud_and_proud
@cloud_and_proud 4 жыл бұрын
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.
@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 6 ай бұрын
which player detection works best??
@possiblyzslot838
@possiblyzslot838 3 ай бұрын
You should back up this claim by identifying the aforementioned method, no?
@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
@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
@root4098
@root4098 4 жыл бұрын
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 4 жыл бұрын
flip the meshinstance around 180 degrees
@root4098
@root4098 4 жыл бұрын
@@garbaj not simple to do that because of how the camera is currently setup. would require camera rewrite
@garbaj
@garbaj 4 жыл бұрын
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 2 жыл бұрын
rotate_y(- deg2rad(eyes.rotation.y * turnspeed)) easy
@mrtwan105
@mrtwan105 4 жыл бұрын
can you do a grapple rope and a crosshair tutorial?
@doomknight233
@doomknight233 3 жыл бұрын
The enemy AI looks away from me. Anyone know a fix?
@daxtonzimmerman3091
@daxtonzimmerman3091 Жыл бұрын
try rotating your mesh 180 degrees.
@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!
@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 kzbin.info/www/bejne/f3XWoHh3n5qrfZI
@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.
@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 4 жыл бұрын
@@hshsjsjsj506 how did you solve this?
@old_pepe
@old_pepe 5 ай бұрын
player is ugly
@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
@madcap7772
@madcap7772 4 жыл бұрын
Pls make a tutorial so that the enemy can shoot us
@thedigitalwolf6932
@thedigitalwolf6932 2 жыл бұрын
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
@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 :(
@zagame4real609
@zagame4real609 3 жыл бұрын
part 3?
@garbaj
@garbaj 3 жыл бұрын
kzbin.info/www/bejne/j3fKo6OmZsujhas
@achillesgaming8569
@achillesgaming8569 4 жыл бұрын
how to enable and disable raycasts
@garbaj
@garbaj 4 жыл бұрын
name_of_raycast.enabled = true
@achillesgaming8569
@achillesgaming8569 4 жыл бұрын
@@garbaj thx you are my hero
@achillesgaming8569
@achillesgaming8569 4 жыл бұрын
I put if Input.is_action_pressed("weapon") aimcast.enabled = false and it does not work
@achillesgaming8569
@achillesgaming8569 4 жыл бұрын
What to put
@nightcode3171
@nightcode3171 4 жыл бұрын
2nd
@editz_king6473
@editz_king6473 4 ай бұрын
Hallo dein Tutorial gefällt mir nicht!!
Enemy AI Series 1: The State Machine
12:10
Garbaj
Рет қаралды 52 М.
How Doom's Enemy AI Works
16:47
decino
Рет қаралды 1,8 МЛН
Стойкость Фёдора поразила всех!
00:58
МИНУС БАЛЛ
Рет қаралды 7 МЛН
Ozoda - Lada ( Official Music Video 2024 )
06:07
Ozoda
Рет қаралды 29 МЛН
Kluster Duo #настольныеигры #boardgames #игры #games #настолки #настольные_игры
00:47
I Made a Game Using ChatGPT
9:51
Rye
Рет қаралды 2,7 МЛН
Godot 4 Easy First Person Animation! (2023)
46:25
Lukky
Рет қаралды 67 М.
How To Make A Doom Clone In Godot 4
27:57
MizizizizTutorials
Рет қаралды 82 М.
Weapon Switching In Godot - FPS Tutorial
14:41
Garbaj
Рет қаралды 34 М.
3 Devs Make An FPS - Godot vs Unity vs Unreal || GameDev Battles
12:39
This is one of my favorite video game exploits
3:27
Garbaj
Рет қаралды 247 М.
Unity ML-Agents 1.0 - A.I. Shooting Game (FULL WALKTHROUGH)
17:03
Sebastian Schuchmann
Рет қаралды 32 М.
Godot 4: Enemy AI using Behavior Trees (BeeHave)
21:04
Taillight Games
Рет қаралды 7 М.
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,5 МЛН
Godot FPS Hitscan Weapons Tutorial
7:23
Garbaj
Рет қаралды 36 М.