I was almost in tears listening to your voice because Brackeys has taken a break from youtube 😢😢😢😢😭😭😭😭
@virusocyrus4 жыл бұрын
No he's done for good :'(
@RedCroissantGames4 жыл бұрын
same buddy :(
@hunterc48814 жыл бұрын
"Good-bye and thanks for everything" doesn't sound remotely like a break tbh.
@monkeyrobotsinc.98753 жыл бұрын
i was in tears listening to his voice for entirely different reasons..... :((((((
@h-aram19333 жыл бұрын
@@monkeyrobotsinc.9875 i guess feeling overwhelmed with how complicated coding seems? for me that was it
@axer10153 жыл бұрын
I feel like this guy might be our Brackeys from now on
@KingTubeAR3 жыл бұрын
But not for beginners
@keshav_trr3 жыл бұрын
@MissYouBrackeys spam this line
@woutkrickx64553 жыл бұрын
never >:(
@baddiegaming758 Жыл бұрын
@@KingTubeAR programmer moment
@davestone87663 жыл бұрын
"in 6 minutes" ... *does tutorial in hyper speed*
@erdgerd95843 жыл бұрын
Jup kinda hard to understand though like 10 minutes would have bbeen great
@Onek3i3 жыл бұрын
Kinda the point tho
@gamermazu85692 жыл бұрын
Slow the speed of video
@Nebulaoblivion2 жыл бұрын
Its easier for people who need it slower, to pause after he says something, than it is for people who need it faster, to try to jump ahead through long silences, or useless chatter.
@davestone87662 жыл бұрын
@@Nebulaoblivion my point being that if I make a video saying "make something in 6 minutes" but really I've just cut everything together in 6 minutes of video but the actual process takes hours and I also have to rewatch that 6 minute video 10 times to try and catch things due to you flying through it. Then the title is a lie, it has nothing to do with the pacing of the tutorial and everything to do with the claims of the title.
@safdaboss86454 жыл бұрын
whoever followed through this tutorial without pausing the video once is a god
@HandleDisliker4 жыл бұрын
No joke, especially when this is my first time hearing his voice (not that it's bad at all just it wasn't anticipated) ...And I came back. For some foolish reason I thought I could follow through at 0.25 speed and You. Were. Not. Joking.
@P4rz1va14 жыл бұрын
yeah, either this guy sped the video up so he could make the title "AI in 6 minutes" or he's just that fast, that's crazy.
@Shezza_12124 жыл бұрын
@@P4rz1va1 it says 6 mins but it took me an hour to follow along, was a painful experience.
@soundzythedev3 жыл бұрын
I paused every 5 seconds
@FINTHRTD3 жыл бұрын
The idea is to watch the video without doing anything, and then after watching it, try to do it yourself. Then it is possible.
@charlescaton Жыл бұрын
To anyone having the player enemy fall or disappear... Make the empty Game Object that you put the Nav Mesh Surface on not a child object of your enemy. This worked for me, Best of luck!!!
@silent_reaper746111 ай бұрын
Thanks man. I’ve had so much trouble trying to figure that out
@dylancoles331411 ай бұрын
thanks! this really helped!
@thomasbelk87459 ай бұрын
Thank you so much!!!!!
@lenardallen97705 ай бұрын
so do we make it a parent>?
@Derekstefan2 ай бұрын
Thanks dude!!
@kerduslegend26442 ай бұрын
what. a. timeless. tutorial. literally as i write this comment this tutorial work even after 4 years later.. thanks unity for making such beginner friendly engine and thanks to you for making such comprehensible tutorial!
@acemoistman4 жыл бұрын
Bruh 6 minutes......im new to C# and I understood that perfectly, you're a fucking beauty
@davegamedevelopment4 жыл бұрын
Haha thanks! :D
@brekol95453 жыл бұрын
iam new too but i dont understand anything as alwyas :D but Daves tutorials are great :DD
@4ourhearts833 жыл бұрын
it was so fast I had couldn't type anything of my own or Dave's code without having to pause or slow down to 0.5, and I type at god speed...
@Your_Sourav.6 ай бұрын
@@davegamedevelopment Hi sir please help me, actually i don not know how to downloaded the project from discord server. So I requested to you kindly tell me how to downloaded it🙏🙏🙏
@maxhrbobrndsted-nv3nz6 ай бұрын
@@Your_Sourav. same
@kburrrrr6 ай бұрын
Amazing tutorial, thank you!! Adding in notes on snags I hit for future reference: How To Add/Set Layer Masks: (1) Click on your game object, in inspector on the upper right is the Layer dropdown. Add twhatIsGround/Enemy/etc as new layers and set accordingly Enemies Not Moving: (1) Make sure your ground and player objects have colliders Projectile Problem: (1) Make sure your projectile has a Rigidbody component added Adding NavMesh Components: (1) You can now add them directly via Unity's Package Manager. Go to Window -> Package Manager -> Packages -> AI Navigation and install that
@kamartyr6 ай бұрын
Thanks!
@ayushsagar80744 жыл бұрын
Best Tutorial for Enemy AI on KZbin
@davegamedevelopment4 жыл бұрын
Thanks a lot! :D
@gaminganimator-qp2ir4 жыл бұрын
agree
@Oliver-cr3nw4 жыл бұрын
definetly
@farisalmiqdad71462 ай бұрын
I keep coming back to this one. surprisingly simple, surprisingly effective.
@fernandosilva96792 жыл бұрын
This tutorial is definitely one of the bests. The only thing I would probably add is the idling function. That way the enemy would stop for a sec or two instead of constantly running around
@mazenhassan20112 жыл бұрын
Can u tell me how to implement that ?
@gamdevgamdevpropro2781 Жыл бұрын
@@MrNPCTHE THIRD CODE if (Time.time < lastDidSomething + pausetime) return; HAS A ERROR SMALL T IN WORD PAUSETIME. THE CORRECT ONE IS if (Time.time < lastDidSomething + pauseTime) return; JUST IN CASE SOMEONE WANT TO USE IT AND IS NOT WORKING,
@justgix7165 Жыл бұрын
How does one get the nav mesh agent
@343guiltyspification11 ай бұрын
@@justgix7165 You go to your Packet Manager under 'Window' at the top. Then you select 'Unity Registry' insted of 'In Project' or 'My Assets' and search for the Nav Mesh Package. And then you install it.
@smokeback2 жыл бұрын
This tutorial is amazing even if am not using unity, really opened up one thing i overlooked separating chase range and attack range .thanks for the breakdown of the base of ai before expanding how smart it behaves .just subbed
@lonr_gsmo45833 жыл бұрын
Mans types so fast visual studio can’t keep up
@shauas4224 Жыл бұрын
Nice script for enemy AI to completely kill all your hope for any tiny bit of performance as soon as your number of enemies is above 10. Good job
@shayaanabbas28814 жыл бұрын
I don't understand only one thing.... HOW ARE YOU SO GOOD?!
@davegamedevelopment4 жыл бұрын
Haha thanks, but I'm not that good :D You can learn that too, just keep watching tutorials :D
@gaminganimator-qp2ir4 жыл бұрын
@@davegamedevelopment i learned c# now
@davegamedevelopment4 жыл бұрын
@@gaminganimator-qp2ir Nice
@gaminganimator-qp2ir4 жыл бұрын
@@davegamedevelopment but gotta learn more:)
@damianuscraft4 жыл бұрын
Same
@KaosWater2 жыл бұрын
I look away for one second and it's already the next video. Great tutorials btw.
@davegamedevelopment2 жыл бұрын
Haha thanks :D
@elixerprince_music3 жыл бұрын
If anyone is having trouble with the baking section you just have to set the areas you want to bake to static in the inspector.
@ryanxezter39102 жыл бұрын
thank you brotha was being so confused to what I was doing and y it wasn't baking lol ty tyty
@partishdarji26 Жыл бұрын
hey! can u tell what is projectile 4 and how to attach it???
@aokutor Жыл бұрын
@@partishdarji26 Hopefully this is not too late. The "Projectile 4" is whatever you want the enemy to instantiate. In the video, it was made into a prefab named Projectile 4.
@partishdarji26 Жыл бұрын
@@aokutor well thx for ur reply but i already got it!
@ShadaSomeGuyYT4 жыл бұрын
This channel is so underrated
@davegamedevelopment4 жыл бұрын
Thanks! Glad you like the videos! :D
@not_herobrine37523 жыл бұрын
@@davegamedevelopment brakeys 2.0
@georgeabidbol51803 жыл бұрын
If you followed this tutorial and your Player is not recognised by the enemy so it never goes toward the player, it might be because your player doesn't have a collider. So, add a capsule collider or something like that to your player it could fix it. I've been struggling with that the past 15 min 😁
@mellemoomoo17012 жыл бұрын
thank you for the tip it realy helps👍
@rprivateaccount51672 жыл бұрын
I found it was because my player wasn't named "playerobj"
@rprivateaccount51672 жыл бұрын
so I went to the script and changed it to the name of the player
@srujanpola37842 жыл бұрын
@@rprivateaccount5167 me too
@dahugo9740 Жыл бұрын
well what if he just goes up to the sky
@luciorojas42783 жыл бұрын
This is how most of tutorials should be! I love everything about it. Directly to the point and explaining just what is needed. Awesome job and Thank you!
@axer10153 жыл бұрын
What about the fact he go faster den SANIC.
@gamermazu85692 жыл бұрын
Slow the speed of the video
@carelesswhisker4155 Жыл бұрын
yeah if "just what is needed" is "nothing at all"
@Betruet2 жыл бұрын
I love your video style and clear code. Subscribed!
@davegamedevelopment2 жыл бұрын
Thanks a lot!
@Mcdoogs3 жыл бұрын
had a little trouble with figuring out layers but got it working after a little more research :) Thanks dude!
@mregghead95212 жыл бұрын
Im having trouble with the layers showing what did you do?
@joshuabauzon23412 жыл бұрын
@@mregghead9521 Same here bro, did you find any solutions?
@ikkinu_19243 ай бұрын
@@mregghead9521 any of you got it working? plz help
@AlexraptorGameDev2 жыл бұрын
Absolutely fantastic tutorial video! I found it absolutely invaluable as a starting point for creating my first Enemy AI. And I expanded it by adding behavior for patrol paths/waypoints, as well as definable 'Idle time' between WalkPoints, combined with a bool option to randomize idle time as well. :)
@KoopaD.WaterTroopa2 жыл бұрын
Hey just wondering how did you make that Idle time between walkpoints? I’m using a slime that jumps around randomly but also stops at times so i would like to have an idle function for it.
@AlexraptorGameDev2 жыл бұрын
@@KoopaD.WaterTroopa Simple really. I create a standard timer variable ie: "Timer -= Time.deltaTime;", that runs in the Patroling function, under "if (distanceToWalkPoint.magnitude < 1f)" Then once the timer has hit zero, I allow "walkPointSet = false" to execute, triggering the AI to find a new walkpoint again. And to finish off I reset the timer when it executes FindWalkPoint();. You can either set the timer variable as a fixed value, or you can call the Random.Range(); function for more unpredictable behavior. I hope that made some sense. :)
@dak5327 Жыл бұрын
Yooo, just wondering how you made the waypoints / patrol paths to work with the code. Beginner coder here bahaha
@obsidian25624 жыл бұрын
Damn right to the point. Very nice tutorial. You didn't waste a moment. Thx for this tutorial.
@davegamedevelopment4 жыл бұрын
Glad you liked it! :D Thanks for watching
@001Camera2 жыл бұрын
did it work for you? if so I need help. my enemy just stands there and does nothing I have no errors. pls help
@Kharabish5 ай бұрын
dude u r awesome i was looking for this for a couple of days thank u so much ♥
@FunNooberCodingForBeginners4 жыл бұрын
This tutorial really helped! Thanks! I am working on FPS AI and a can't tell you how much this helped! Thumbs up!
@davegamedevelopment2 жыл бұрын
Glad I could help!
@Your_Sourav.6 ай бұрын
@@davegamedevelopment Hi sir please help me, actually i don not know how to downloaded the project from discord server. So I requested to you kindly tell me how to downloaded it
@breeze31042 жыл бұрын
Thank you, even helped out in the discord.
@TheAwesomeAlan2 жыл бұрын
I have a weird, but small issue. When the enemy is attacking, the bullet spawns but it won't turn with the enemy. So it begins firing when I enter the attack range, but it's never facing me and never updates to my current position.
@micol04 Жыл бұрын
i have same. how did you fix this?
@TheAwesomeAlan Жыл бұрын
@@micol04 Never did.
@micol04 Жыл бұрын
I just did I added spawn point to a code I have and called in before transform.position .. instead of transform.position I used (spawnPoint.transform.Position)
@micol04 Жыл бұрын
It spawns from wherever you put the spawn point game object irregardless of where it turns Use quaternion also instead of rotation
@Lazy2Dev7 ай бұрын
Great tutorial man, it’s a big help cause I’m very new to enemy ai
@shanjohnkj68513 жыл бұрын
This is Brackeys Channel. I think He is doing Side Business from this channel.... hahaha . Exact As Brackeys
@noony311220092 жыл бұрын
ur really amazing iam really looking forward for ur next tutorials !!
@davegamedevelopment2 жыл бұрын
Thanks, appreciate it!
@miguelarocazarco57444 жыл бұрын
Your channel looks very very good, your voice reminds me brackeys too hahaha
@davegamedevelopment4 жыл бұрын
Haha, thanks a lot! :D
@gaminganimator-qp2ir4 жыл бұрын
@@davegamedevelopment wait are u .................................
@Shezza_12124 жыл бұрын
@@gaminganimator-qp2ir no, his voice seems a bit too deep as well as the fact that brackeys was well serious about leaving KZbin.
@USBEN.2 жыл бұрын
Thankyou , this script acts as a nice base to build upon more complex behaviours.
@davegamedevelopment2 жыл бұрын
Glad I could help! :D
@Underarmour813 жыл бұрын
Awesome tutorial! This worked out amazing in my game.
@davegamedevelopment2 жыл бұрын
Glad to hear that!
@unitygamedev23262 жыл бұрын
this is really cool man , thank you very much
@davegamedevelopment2 жыл бұрын
Glad you like it!
@base48003 жыл бұрын
Dave if you continue creating videos like this one you will be the next Brackeys on KZbin or even bigger, congratulations and thanks for this amazing content. 👍
@sohamacharya1713 жыл бұрын
His voice is definitely Brackeys
@BtaraDev2 жыл бұрын
Thank You, This really helped me learn more about NavMeshAgents. I modified the code and used it to make an AI for my Game.
@davegamedevelopment2 жыл бұрын
Glad I could help!
@BlackLoboGaming2 жыл бұрын
I don't know if you still read these but thank you!! this helped me so much. it was straight the point no chitter chatter. Greate video.
@strikelight10413 жыл бұрын
for anyone whos enemy is falling thru the floor, click window, ai, navigation, and then select the floor and anything else u want the enemy to walk on, then click bake and it should work
@time1333 жыл бұрын
how to select the floor???
@strikelight10413 жыл бұрын
@@time133 click it? im not sure what you mean
@strikelight10413 жыл бұрын
@@time133 after you click navigation, you should be able to select the floor and then it will appear on the right, and then you click bake
@developer70462 жыл бұрын
My enemy is going down the ground when I go close to him, I tried playing with navigation settings, adding collider, adding rigidbody and non of these worked, any solution please? Also I have no console errors.
@budazenYT2 жыл бұрын
@@potato1947 same 😭
@alecbeaton68623 жыл бұрын
This boi is helping me so much. You are amazing
@SkyZizzle Жыл бұрын
The “Nav Mesh Surface” script doesn’t appear the same way yours appears. Any way to fix?
@FOLDIK_UA8 ай бұрын
write your own script based on the logic of enemies. I don't see any other solution🥲
@TheDodoKing4 ай бұрын
Did you install the package?
@theozetterberg45913 ай бұрын
tysm with a bit of tweaking this worked really good
@michelmurr19493 жыл бұрын
dude don't stop making videos you have some amazing content that A LOT of people can learn from
@nicolomontuschi67193 жыл бұрын
Please bro continue to post videos you are great and we miss you!,ps your website is amazing!
@Galaxy_World3 жыл бұрын
btw u should do it like this: make it so if the enemy sees you with their own eyes with raycast and that they are in range of the sight, this would be infinitely more realistic.
@ray2dasherthedragon336 Жыл бұрын
Yea thats what I need to be honest
@NeroForte_2 жыл бұрын
Now I understand the difference between blueprints and c#.
@davegamedevelopment2 жыл бұрын
Haha :D
@Poley12 Жыл бұрын
There no navmeshagent for me and it is driving me insane
@ScientObject405 ай бұрын
I think you have to install it in the package manager.
@Poley125 ай бұрын
Yeh it is not in package management for me
@damvcoool2 жыл бұрын
I really like this because it's the only Tutorial I have found where ai patrols without multiple patrol points
@davegamedevelopment2 жыл бұрын
Glad I could help!
@spielsuchtige50113 жыл бұрын
Hey, it shows me an error at line 31: Object Reference not set to an Instance of an object? and my ai doesnt move, how do i fix those things?
@fezza22833 жыл бұрын
have you made sure to reference the object its missing in the editor? If you want you can msg me on discord for more help. Fezza#4066
@adham.walid.khatab.68742 жыл бұрын
Bet your soft is absolutely amazing! Never give up
@Delvarn4 жыл бұрын
This is a brilliant tutorial, but I'm stuck on the layer masking. I've never done it before, how do I go about creating them properly?
@davegamedevelopment4 жыл бұрын
Click on your enemy object, select the Layermask dropdown in the top right of the inspector (It should say "Default" there), then make a new Layermask called "whatIsEnemy" and make sure to select it instead of "Default" (on all your enemies) :D
@Delvarn4 жыл бұрын
@@davegamedevelopment Worked a treat, thanks!
@harryprettejohn57227 ай бұрын
I am confused about this as well!
@harryprettejohn57227 ай бұрын
I can't find the layermask
@ShawnGreyling3 жыл бұрын
THIS IS AMAZING! Don't stop making these tutorials.
@davegamedevelopment2 жыл бұрын
Thanks a lot! And well... I did stop :D But from now on I'll be uploading regularly again!
@GameDevNerd3 жыл бұрын
This was excellent. Clean, simple and concise explanation of how to use Unity's NavMeshAgent system. I've already got a 3D model of this demon-lord looking creature with movement and animation controls programmed, even did the IK adjustments to keep his feet perfectly on the terrain. Now I need to implement AI agents to control enemies and this showed me how to get that working. Gonna start with one simple ranged attack spell then hook up the whole game system for spells and weapons to AI agents based on what attacks they're able to use. 😄
@innerbladet2 жыл бұрын
Sounds like a Great game in development
@GameDevNerd2 жыл бұрын
@@innerbladet was more of a game prototype I was making migrating from DirectX to Unity and learning how things worked in Unity. I ended up getting hired by a company a couple months later to do this stuff in a commercial game. Unity is really easy if you've ever worked with OpenGL or DirectX and built small engines to power your own games. 80% of the hard work is done for you already and you only have to create the game. 🙂
@innerbladet2 жыл бұрын
@@GameDevNerd thx for the tips and hope everything goes good for you
@judetremblay-e6l11 ай бұрын
do you know how to get nav mesh
@robbytegd43473 жыл бұрын
The only thing I can say about this video is you've got a new subscriber :)
@atakankuloglu48772 жыл бұрын
The voice is the same with Brackeys?
@davegamedevelopment2 жыл бұрын
Haha no, only sounds similar :D
@deadasadodo10162 жыл бұрын
How do you download the nav mesh
@Nemko776 ай бұрын
Maybe you know it already but it's ai navigation in the package manager.
@kirby68443 жыл бұрын
So I’ve been creating a game and this was really helpful. Though I am making a horror game. But still was helpful! Thanks!
@Dbdelaney43 жыл бұрын
I have 2 issues. One the enemy doesn't patrol it just kinda stands there. the walkpoint keeps changing but the enemy doesn't move. Also when the enemy reaches a certain point it just stops and refuses to move. Any help would be great.
@cbasx18872 жыл бұрын
happens same to me
@manishshrestha42632 жыл бұрын
This reply is for new watchers. Add This so it doesn't happens to you. " if (Physics.Raycast(walkPoint, -transform.up, 2f, whatIsGround)) walkPointSet = true;" In this view " 2f" is missing.
@the_chocolade2 жыл бұрын
@@manishshrestha4263 what should i do?
@melder04872 жыл бұрын
@Chocolade YT It is posible your ground is not on the "WhatIsGround" Layer
@elias-jugen2 жыл бұрын
For anyone has their AIs not patrolling, assigning the value walkPointRange will fix this problem
@TheDeathskull373 ай бұрын
There are a few changes I made to this. The AI needs to make sure that the path is complete before chasing or attacking the player. Otherwise, it will walk and float across gaps, walk through walls, and attack through walls. For enemies that shoot projectiles, I made them raycast towards the player to see if the player is within their line of sight, and if they don't see the player, they move closer until they can actually hit the player with the projectile. Otherwise, they get stuck trying to shoot a player from behind a wall.
@P4rz1va14 жыл бұрын
I altered this to make an enemy that walks between its start point and a given point, after chasing and losing sight of you it returns to its start point.
@AkariK33 жыл бұрын
Please, would you mind to share how you did it? TY in advance
@Gszada2 жыл бұрын
Your code is a pleasure to read
@davegamedevelopment2 жыл бұрын
Thanks!
@iggythemad87014 жыл бұрын
This is great! Straight to the point. I have a request please
@davegamedevelopment4 жыл бұрын
Thanks for the idea, maybe I'll do that somewhen :D But with a bit of tweaking, you could split the attack state into "attack", "defense" and "approach". You only need to come up with some sort of logic when the enemy should do what :D
@iggythemad87014 жыл бұрын
@@davegamedevelopment my main problem is how to make the ai strafe around, or move nearby the player, instead of just staying immobile infront of him.
@davegamedevelopment4 жыл бұрын
@@iggythemad8701 For strafing just add transform.LookAt(player.transform) and move the enemy to the "transform.right" direction. By always looking at the player and walking right the enemy should walk in circles around the player :D
@iggythemad87014 жыл бұрын
@@davegamedevelopment why didnt I think of this... i thought i had to use the navmesh or something
@davegamedevelopment4 жыл бұрын
@@iggythemad8701 No problem, I think you should be able to use NavMeshAgents combined with other movements, just make sure to use the agent.ClearPath() function, otherwise the navMesh agent is constantly trying to get to the player :D
@tomatrix75254 жыл бұрын
Best youtube on Game Dev hands down. Especially now that Brackeys gone, you will grow even more
@tyler72683 жыл бұрын
This is exactly the kind of tutorial i need. And is the exact solution i was looking for. Thank you so much!
@berintandaniel1643 Жыл бұрын
Look into coroutines instead of invoking. Gives so much more flexibility and invoking is also more expensive. Amazing tutorials as always.
@ascheron2 Жыл бұрын
There is no Bake Button.. I cant bake
@yoyo123453 жыл бұрын
I really like the cool BEAN
@yourfellowgamer4873 жыл бұрын
dani be like
@Emr3letzemre Жыл бұрын
help my ai IS FLYING AWAY
@hefferwolff35785 ай бұрын
This was fantastic for my game!
@spoogleh98132 жыл бұрын
so ur saying i could of just downloaded the script😐
@EvanStreblow3 жыл бұрын
Super helpful, man. Thanks!
@rocketthab8.53 жыл бұрын
it doesnt work for me the enemy just flies into space like it has reversed gravity
@thediamondgauntlet88883 жыл бұрын
same mine was glitched off the map and starts crazy flying help
@jettnash52172 жыл бұрын
Well this is exactly what I was looking for, thanks a lot!
@davegamedevelopment2 жыл бұрын
Glad I could help!
@bakedpizza40372 жыл бұрын
The enemy ai script automatic turns off ... Why???
@Cat_6921 Жыл бұрын
@@bakedpizza4037 Because the name of the player
@boy-with-a-keyboard3 жыл бұрын
followed this exactly and when i tried to play it he plummeted the earth at 350 mile per hour Edit: found the problem and it was how close he was to the ground just get him closer to the ground and it should work
@thegannman45582 жыл бұрын
Thank you so much, I was having a lot of trouble with this
@redsgaming46142 жыл бұрын
Not sure what I am doing wrong, I downloaded your code and named layers to WhatIsEnemy, WhatIsGround etc. yet the layer masks are not working. I only have a ground to mask with right now so I gave it WhatIsGround and baked it. I have all the imports right in the Nav Mesh Agent yet the object is still falling through the ground. Originally the enemy was floating on the y axis, but now it is just falling through the ground.
@geoffreyaji8659 Жыл бұрын
were you able to figure out why this was happening
@__Rizzler__ Жыл бұрын
this tutorial is underrated asf
@claudiodias00894 жыл бұрын
hmm... the NavMeshSurface doesn't have the baking options or most of the others you have /: pls help
@davegamedevelopment4 жыл бұрын
Did you import the nav mesh components correctly? :D
@GameEditMrCzopowski4 жыл бұрын
@@davegamedevelopment how do you import the nav mesh components correctly?
@CuriousCreatorsYT4 жыл бұрын
Make sure your GameObject is set to Static. Your NavMesh surface should be static to bake.
@anshg_71253 жыл бұрын
thanks a lot Dave! I subbed :D
@gamingthomas81462 жыл бұрын
Thanks for the tutorial but I have one question. When the enemy comes in sight it flies towards me and I keep getting this error: "SetDestination" can only be called on an active agent that has been placed on NavMesh.
@devxtreme2592 жыл бұрын
Make sure you select navigation and bake
@angelchurrumais2 жыл бұрын
remember you need to creat a new empty GameObject and then add the component NavMeshSurface. In the NavMeshSuface, you have to bake your terrain or ground data.
@gameginger55293 жыл бұрын
such clean and organised codes , totally awsm tut
@ricardovicente96662 жыл бұрын
Amazing tutorial, but I was wondering how could a speed variable be implemented in the ChasePlayer function, so that different enemies may have different speeds
@davegamedevelopment2 жыл бұрын
You can change the speed in the navmeshagent settings
@Nitzustaja2 жыл бұрын
if im right, you could do something like this: first make int ,string,scriptable object or anything that you could choose depending what "type of enemy you want". then do something like this public int enemyType; void Update(){ if(enemyType==1)agent.speed=1f; if(enemyType==2)agent.speed=2f; if(enemyType==3)agent.speed=3f; } then make prefab for enemy type 1,2 and 3(remember to change enemytype from the prefab )
@Nitzustaja2 жыл бұрын
thats how you could make the ai have stamina and start walking when stamina is low, hope that you understand what i mean with that
@yimy98992 жыл бұрын
6 minutes?! this took me half an hour!
@sapphirecorn36352 жыл бұрын
Hey, so I'm completely new to coding and unity in general, and I'm having issues with my enemy falling through the map extremely quickly, and it says the walk point is what I'm assuming is the position of the entity. Any idea why?
@zypherone2 жыл бұрын
Do you have an active rigid body on the enemy? Because if it’s just falling through then maybe the collision is off
@Emerald_Dev2 жыл бұрын
Same I’ve been fiddling with it for a while now and it just keeps happening, not sure how to fix it.
@kevCjm6dhhihiujkbbhjhvcfyhuiij Жыл бұрын
Did you add the navmeshsurface to your ground? I added the navmeshsurface to the wrong thing, and when I applied it to my ground it stopped falling.
@satobi462 жыл бұрын
Great tutorial!
@davegamedevelopment2 жыл бұрын
Thanks!
@agamesjourney42924 жыл бұрын
Dave the enemy's aren't shooting with me how do i fix this aside that a great tuturial
@axer10153 жыл бұрын
Sorry, I have no knowledge on this, what you can try is re-watching the tutorial to check for errors or try a new tutorial.
@vidjey25974 ай бұрын
probably because your player tag is not the same as in the script
@mrpotato8196 Жыл бұрын
Nice! I spent a long time doing the detection, I wanted it to be like if the player is out of sight the enemy will move to where he was last seen, it took a long time because it was the raycasts being dumb, *nice tutorial tho*
@ScratchTuto3 жыл бұрын
Now I've downloaded the zip file but how I get those godes in the unity editor?
@not_herobrine37523 жыл бұрын
drag and drop into the assets folder... at least thats what i did
@ScratchTuto3 жыл бұрын
@@not_herobrine3752 It didn't work whit me
@not_herobrine37523 жыл бұрын
@@ScratchTuto are you sure you have downloaded the right version of the zip file? like the latest version for unity 2020 and so on?
@ScratchTuto3 жыл бұрын
@@not_herobrine3752 idk I dosen't need it any more but thx for the help
@cloakedd_3 жыл бұрын
@@not_herobrine3752 then what do I do?
@transsatanic45913 жыл бұрын
I literally just straight up assumed you ripped one of Brackey's videos I was so confident that was his voice! It's funny how two game development people on youtube sound so similar lol, thank you for the video!
@ashleyk91413 жыл бұрын
Hello Dave, great video! I followed this tutorial for a game where a monster chases a first person player. Everything works great except the patrolling. I can see it setting new walk points in the inspector, but the monster does not go to them. Any idea how to fix this? Thanks!
@martinschifer36033 жыл бұрын
Same here!! Did you find any solution?
@cooperswain31183 жыл бұрын
hey just wondering if you found the solution, i am having the same problem.
@dralbintokomesemito88292 жыл бұрын
Its most likely because the walkpoint is being set at a point that is unreachable. You should set a timer for the walkpoint instead of the walkpoint changing when one was reached
@elias-jugen2 жыл бұрын
You must set the walkPointRange value so that the variables randomX and randomZ work properly
@M3g4t0n2 жыл бұрын
Very usefull tutorial! I've already used it to program some turrets to fire at me and a ground enemy to chase and attack me!
@davegamedevelopment2 жыл бұрын
Thanks, glad I could help!
@x.41322 жыл бұрын
Great tutorial, but one big thing is missing. Sometimes the random walkpoint is set in a wall or some obstacle and the "AI-Object" doesn't move and is stuck....
@001Camera2 жыл бұрын
Same it doesnt move when i do it!
@junaidjamshed81042 жыл бұрын
@@001Camera Hey Set the roads sidewalks or any ground area to the Layer Ground don't set the walls and other objects like building or mountains to Layer Ground
@imaUFO6724 жыл бұрын
Thanks dude this was very helpful!
@NastanielBabablueskee4 жыл бұрын
Really enjoyed this tutorial. You've gotten my sub. I had two issues, one being my projectiles would only move in one direction, even if the enemy rotated. Two being the enemy would rotate on the X axis when shooting -- I only wanted it to rotate on the Y axis. These two were quite easy to fix. In AttackPlayer() Vector3 newPlayer = player.position;
@Bilallakho_3 жыл бұрын
help, on the Rigidbody=rb line there is a problem on the May change part idk what to do help me pls, it just shows this assets\EnemyAiTutorial.cs(93,129): error CS1003: Syntax error, ',' expected
@Bilallakho_3 жыл бұрын
please help me since it says that may Change does not exist in the ucrrent context. im new to unity pls help
@NandKumar-ex6mw3 жыл бұрын
@@Bilallakho_ can you comment the script you used...
@lvaedho5283 Жыл бұрын
Thank you for the tutorial and script, its very helping . . . . .
@fate704 жыл бұрын
my enemy randomly sinks through the map edit: what i mean is that the Y value is going crazy - it will move a bit to the left, then shoot downwards in the space of around a millisecond as soon as the game starts, without travelling there. It just instantly warps below the map. I am using terrain that is very mountainous as the ground layer, though. maybe that is the problem? could you help me please? edit 2: the same thing happens with the exact same ground that you are using.
@lordzockt18534 жыл бұрын
did you set the " What is Ground“ var right ?
@lordzockt18534 жыл бұрын
I'm having the same problem, the only thing that is different after changing stuff up(So that he dosen't fall down) is that my enemy won't move a bit ;/
@someonenamedegg184410 ай бұрын
I dont even have that which is annoying, it dosent show the "what is player" or "what is ground"@@lordzockt1853
@damonmichiels Жыл бұрын
thank you dave/ game development man. cried but thanks
@chrissiededeer72563 жыл бұрын
Can someone help me out if n put the NavMeshSurface on an object it doesnt show me the same menu Theres an empty slot called NavMeshData and an agent type ID Edit and no bake option