Very elegant and intuitive solution, and great explanation. Your channel in general is such a good source for learning Godot.
@garbaj4 жыл бұрын
Appreciate it. Glad you found the video helpful!
@Gredran2 жыл бұрын
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 Жыл бұрын
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.
@abdulbasitado61804 жыл бұрын
Amazing tutorials as always. It's good to see how your channel has grown.
@garbaj4 жыл бұрын
Thanks for the support :)
@gdmattartz30714 жыл бұрын
Thanks for the Enemy AI! i modified it so the enemy can shoot me and made it difficult to kill. thanks !
@garbaj4 жыл бұрын
Nice, glad to see people building on my tutorials
@disdis61273 жыл бұрын
Thank you for making such great videos. Please make more on AI
@jetiscander4 жыл бұрын
When will you release the next part? it is very useful and interesting
@KevinCodes4 жыл бұрын
very cool tutorial, not currently working on a fps atm but i enjoyed regardless & will keep this vid in mind if/when i do!
@garbaj4 жыл бұрын
Awesome, thanks for watching
@scorder85553 жыл бұрын
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.
@brayansaldana34962 жыл бұрын
can you upload another part I'm learning a lot with you tutorials, and thanks. 😁 nobody teach this like you does.
@frankoesavage83144 жыл бұрын
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
@frankoesavage83144 жыл бұрын
Holy shit I can finally say Im a Game Dev
@garbaj4 жыл бұрын
Aren't simple solutions great? Always Glad to help
@frankoesavage83144 жыл бұрын
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
@codingkam12524 жыл бұрын
4:29 another way of doing it is if body.name== "Player": state = alert
@garbaj4 жыл бұрын
Oh yeah, I forgot about that! Very useful
@jetiscander4 жыл бұрын
You can have a lot of players (for i.e. multiplayer game or different characters at singleplayer) with different names
@BigDaddyWes4 жыл бұрын
Doing it by group is way more versatile, but there's always more than one way to program depending on your needs.
@ziggleboy13093 жыл бұрын
✋🖐️🖐️I followed your tutorials fully. My Enemy is rotating again and again in player direction.🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃🔃 How can I stop them.
@nightcode31714 жыл бұрын
Again, this is very simple and very Helpful. Thankyou for the tutorial.
@garbaj4 жыл бұрын
You're welcome!
@nightcode31714 жыл бұрын
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.
@garbaj4 жыл бұрын
Nice, glad you're experimenting with your own ideas, I wish everyone did this!
@Wodsobe4 жыл бұрын
This was a pretty epic tutorial!
@garbaj4 жыл бұрын
Thanks, glad to see you back btw
@Wodsobe4 жыл бұрын
@@garbaj thanks!
@diariodeumdesenvolvedor3 жыл бұрын
Man you helped me a lot! Thank you so much!!
@frankoesavage83144 жыл бұрын
Hell yeah! , Now sheit is gonna start getting interesting
@garbaj4 жыл бұрын
oh yeah
@frankoesavage83144 жыл бұрын
@@garbaj And i Shall start watching now lol
@severno19033 жыл бұрын
you are a good teacher
@g0ldhat553 жыл бұрын
Can you do a tutorial on how to spawn bullet lines for raycast weapons so that like weapons look like they are shooting bullets :>
@nuralimedeu4 жыл бұрын
Yay!
@Mentleif4 жыл бұрын
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
@garbaj4 жыл бұрын
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
@saaamoth4 жыл бұрын
These videos are so cool
@tubagusthariqgilbraltar74994 жыл бұрын
Hey Garbaj i want ask, What's the use of a polygon collision? I am completely new to Godot btw
@garbaj4 жыл бұрын
It lets you create a custom collision shape if something like a cube or a capsule isn't good enough
@tubagusthariqgilbraltar74994 жыл бұрын
@@garbaj YES FINALYY SOMEONE THATS SIMPLE TO UNDERSTAND like your vid btw
@ishkapoor79314 жыл бұрын
this was really helpful. thankyou so much
@garbaj4 жыл бұрын
You're welcome!
@judelightning2423 жыл бұрын
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
@7622 жыл бұрын
Next part please!!!
@sloungy2 жыл бұрын
Can you do a next part where you show us how to make the enemy deal damage to use
@pmlpvdlte28014 жыл бұрын
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
@ismaelsilveira23164 жыл бұрын
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
@garbaj4 жыл бұрын
Maybe you added the character mesh backwards?
@ismaelsilveira23164 жыл бұрын
@@garbaj No, because the raycast also turns to the opposite side. By the way, thanks for replying quickly
@ismaelsilveira23164 жыл бұрын
@@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.
@DrNabeel204 жыл бұрын
amazing! thank you ☺️🤩
@garbaj4 жыл бұрын
You’re welcome 😊
@pyrosoup4413 Жыл бұрын
Don't use this video if you're using godot 4, many changes just gonna cause a headache
@rmt35899 ай бұрын
What if I use this method without using Godot at all! Bwahahahahahahahshshsha
@itn0es1594 жыл бұрын
saw your comment on noob hunter's vid
@garbaj4 жыл бұрын
Didn't expect it to get so many likes lol
@alphisticgamer37994 жыл бұрын
hi bro i want a tutorial on enemy patrol, chase, and attack in 3d, hope you help me with this please!!.
@wash9914 күн бұрын
Let me know if you found something
@jaxamus134 жыл бұрын
What happened to the series I was rlly relying on it
@garbaj4 жыл бұрын
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
@jamingchannel30214 жыл бұрын
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
@garbaj4 жыл бұрын
The mesh isn't facing forward. In the enemy scene, turn the mesh around 180 degrees
@achillesgaming85694 жыл бұрын
still no working for me even if I turn it Help!!!!!!
@gankstabuilder6603 жыл бұрын
@@garbaj thank you so much it worked like a charm!
@tridra57144 жыл бұрын
More Please
@FederxDev8 ай бұрын
have you ever updated this tutorial for godot 4?
@bity-bite4 жыл бұрын
Yes like
@cmds.learning74264 жыл бұрын
really helpful!!!!
@garbaj4 жыл бұрын
Glad you think so!
@seraph82932 жыл бұрын
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
@P0150Ngmod3 жыл бұрын
the enemy looks at me with his back lol, how do i fix this?
@garbaj3 жыл бұрын
rotate the enemy mesh instance node 180 degrees
@P0150Ngmod3 жыл бұрын
@@garbaj thanks!
@disdis61273 жыл бұрын
Will you please make video on coding AI's thirst,hubger,water finding and food finding in Godot
@slappa73773 жыл бұрын
Release part 3 please mate
@ОлегЛукин-д5ф2 жыл бұрын
Do next part please
@cloud_and_proud4 жыл бұрын
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 Жыл бұрын
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.
@naxusv72326 ай бұрын
which player detection works best??
@possiblyzslot8383 ай бұрын
You should back up this claim by identifying the aforementioned method, no?
@gdmattartz30714 жыл бұрын
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?
@garbaj4 жыл бұрын
You probably added the character model backwards
@xxdarkking368xx52 жыл бұрын
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 Жыл бұрын
having the same problem, did you fix it?
@carlsonraywithers3368 Жыл бұрын
@@Ceisrielrotate ur mesh to 180
@root40984 жыл бұрын
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?
@garbaj4 жыл бұрын
flip the meshinstance around 180 degrees
@root40984 жыл бұрын
@@garbaj not simple to do that because of how the camera is currently setup. would require camera rewrite
@garbaj4 жыл бұрын
Better rip the bandaid off and get it done now otherwise it's just going to cause more problems in the future
can you do a grapple rope and a crosshair tutorial?
@doomknight2333 жыл бұрын
The enemy AI looks away from me. Anyone know a fix?
@daxtonzimmerman3091 Жыл бұрын
try rotating your mesh 180 degrees.
@disdis61273 жыл бұрын
Hi, I found your channel today so, therefore you are seeing so many comments of mine 😅
@garbaj3 жыл бұрын
Welcome to the channel!
@denizdemir92554 жыл бұрын
Can you make the enemy shoot projectiles?
@garbaj4 жыл бұрын
Yes it's very easy. Watch my projectile weapon tutorial to get some ideas on how to do it kzbin.info/www/bejne/f3XWoHh3n5qrfZI
@denizdemir92554 жыл бұрын
@@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.
@hshsjsjsj5064 жыл бұрын
someone help why my enemy is facing in the opposite direction when player is entering the collision shape? :(
@hshsjsjsj5064 жыл бұрын
update i already solve the issue haha
@root40984 жыл бұрын
@@hshsjsjsj506 how did you solve this?
@old_pepe5 ай бұрын
player is ugly
@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
@madcap77724 жыл бұрын
Pls make a tutorial so that the enemy can shoot us
@thedigitalwolf69322 жыл бұрын
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 Жыл бұрын
make sure you have the variable raycast or it will not work
@chedev Жыл бұрын
and make sure you have collision shape in the enemy
@itsfela4 жыл бұрын
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 :(
@zagame4real6093 жыл бұрын
part 3?
@garbaj3 жыл бұрын
kzbin.info/www/bejne/j3fKo6OmZsujhas
@achillesgaming85694 жыл бұрын
how to enable and disable raycasts
@garbaj4 жыл бұрын
name_of_raycast.enabled = true
@achillesgaming85694 жыл бұрын
@@garbaj thx you are my hero
@achillesgaming85694 жыл бұрын
I put if Input.is_action_pressed("weapon") aimcast.enabled = false and it does not work