Тёмный

How to use Unity NavMesh Pathfinding! (Unity Tutorial) 

Code Monkey
Подписаться 545 тыс.
Просмотров 212 тыс.
50% 1

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

 

28 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 293   
@CodeMonkeyUnity
@CodeMonkeyUnity 3 года назад
✅ Get the FULL course here at 80% OFF!! 🌍 unitycodemonkey.com/courseultimateoverview.php 👍 Learn how to make BETTER games FASTER by using all the Unity Tools and Features at your disposal!
@NoldoWalker
@NoldoWalker 3 года назад
is there some lessons about mixing navmesh for npc and a way to use it to forbid controlable Player character to go somwhere?
@CodeMonkeyUnity
@CodeMonkeyUnity 3 года назад
@@NoldoWalker I cover area types in the end of the video, you can use that to disable the player from going somewhere if you're using NavMesh to move the player. Each agent has their mask for areas they can traverse, you can make that different for the Player or NPCs
@NoldoWalker
@NoldoWalker 3 года назад
​@@CodeMonkeyUnity i mean how to prevent some character to move if it controled by player. Other words : is navmesh working same way if you control actor by keys trough AddForce / aplying new transform.position value
@DannyHodge95
@DannyHodge95 3 года назад
Jesus, this used to be a complete pain to get working, and now it's like 2 steps, the Unity team have smashed this! Thanks for the tutorial
@ChrisVideosGreek
@ChrisVideosGreek 3 года назад
Never stop these videos. l'm a beginner. Totally the best way to learn some things even if without the course (even if l think it's cool)!
@minedog4141
@minedog4141 3 года назад
I hope you will have a great journey!
@ChrisVideosGreek
@ChrisVideosGreek 2 года назад
@@BeardBarians he hasn't l think
@seb.5053
@seb.5053 3 года назад
I legit saw you today in the supermarket, recognized you by your voice.
@alextrollip7707
@alextrollip7707 3 года назад
Crazy. I literally just spent today on this. Doing the surfaces and mesh modifiers was interesting.
@EskChan19
@EskChan19 3 года назад
One thing that i'd like to add is that there's a Component called NavMeshObstacle that has a few settings and can be made an obstacle at runtime without needing to be baked. That's very usefull if you make a game where the walkable area can lessen mid-game, for example a Strategy Game where you build buildings. Adding the Component to the buildings Prefab will make it so that the buildings will no longer be considered walkable for Agents, even if there is a pre-baked navmesh there
@CodeMonkeyUnity
@CodeMonkeyUnity 3 года назад
Yup, I plan to cover that and more advanced use cases in another video when I make the first course update.
@TheKr0ckeR
@TheKr0ckeR 2 года назад
@@CodeMonkeyUnity waiting
@AtariKafa
@AtariKafa 3 года назад
Ultimate Unity Overview awesome keep updating thank you :)
@daffertube
@daffertube 2 года назад
Friendly reminder to enable Gizmos in your scene viewfinder. Otherwise you won't see the blue navmesh.
@astroboystan
@astroboystan Год назад
OH my gods thank you!! The old tuts i watched told me to pull up NavMeshSurfaceComponenet which I'm not sure exists anymore and I was about to have a breakdown because I didn't know how else to get the level working. THANK YOU!
@kotzikuche7883
@kotzikuche7883 3 года назад
Insane, I was literally trying to figure out how the navmesh works and this video showed up! Thanks mate you helped me out a lot 👍
@slimxshady6111
@slimxshady6111 2 года назад
First video i've seen of yours and won't be my last! Thank you very much for going through this, especially the second half where you explained every option in NavMesh. I feel a lot of tutorials show you but don't care about understanding, which leaves you dry the moment you try to change something for your own game. But now I properly understand how NavMesh works, and have utilized it great in my game! Have a great day!
@CodeMonkeyUnity
@CodeMonkeyUnity 2 года назад
I'm glad you liked the video! Thanks!
@peche87_gameDev
@peche87_gameDev 3 года назад
I would like to see how to manage bunch of entities trying to achieve the same position. Sometimes, there are a kind of clamping between all moving entities or entities that seem bouncing trying to reach their goals and not stop when there are a few of them at the goal position. I think the best way to manage that is with flow fields but I would like to see an approach with only nav agents, nav obstacles and set them dynamically. Great content as usual! :)
@CodeMonkeyUnity
@CodeMonkeyUnity 3 года назад
Unity's NavMesh already has object avoidance built-in, so with the default settings you won't see them overlap. You can see that in action in the RTS game where I used NavMesh ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-y601TRfoxc4.html For a massive amount of agents then yeah using flow fields would probably be the better approach.
@peche87_gameDev
@peche87_gameDev 3 года назад
@@CodeMonkeyUnity Thank you so much for taking the time to answer it to me. And thank you for all your content as usual. The best content and explanations as usual dude, thanks!
@geodude1725
@geodude1725 3 года назад
This is fantastic - would love to see this with some logic using unityVS with scenarios like the Nav agent picking up then dropping off a box at his destination. Thanks CM!
@justinwhite2725
@justinwhite2725 3 года назад
Ooh thanks for this. Been thinking about navmeshes recently.
@jesse143_
@jesse143_ 3 года назад
WOOHOO NEW CODE MONKEY TUTORIAL THIS IS F-CKING AMAZING
@Maggiethegsd
@Maggiethegsd 3 года назад
I get annoyed by your ads, but goddamn the tutorials are clear and awesome. Brackeys one got a bit outdated so I came here, and found everything that I needed. Thanks!
@TheBrianDriscoll
@TheBrianDriscoll 8 месяцев назад
????? How about all the free content he releases?
@twinguy9633
@twinguy9633 7 месяцев назад
@@TheBrianDriscoll He advertises it in a boring annoying way, its not about the advertising itself.
@TheAntox007
@TheAntox007 Год назад
Thank you for an explanation, finally figured out the damned stairs and the jump, thanks!
@castlecodersltd
@castlecodersltd 2 года назад
A good explanation. Thanks
@a.technology1446
@a.technology1446 3 года назад
We can't imagine unity tutorials without u ❤️🙌
@sultanrahil3380
@sultanrahil3380 2 года назад
Amazing lecture. Good job
@seba0456
@seba0456 3 года назад
I love RU-vid for showing UE4 user unity tutorials 😀
@aussieraver7182
@aussieraver7182 2 года назад
Amazing as always, you've got yourself a subscriber!
@CodeMonkeyUnity
@CodeMonkeyUnity 2 года назад
I'm glad you liked the video! Thanks!
@brendanleighton
@brendanleighton 2 года назад
Thanks Code Monkey! That NavMesh was driving me bananas!
@memepotater9503
@memepotater9503 3 года назад
As it stands, the game I'm making doesn't require this fancy nevmesh. But I do love watching your videos. It's both entertaining and make my mind go wild from thinking of all the crazy ways I could use the different things you introduce to us. Love from the 🥔 gang.
@CodeMonkeyUnity
@CodeMonkeyUnity 3 года назад
Thanks for watching!
@ElSonk
@ElSonk 3 года назад
Ah finally, a new Codemonkey tutorial!!
@29void71
@29void71 2 года назад
Amazing tutorial!
@webplace8268
@webplace8268 2 года назад
Great tutorial. Im working on a horror game and im shitting myself bc there a capsule following me and I love how easy it was
@mdk162
@mdk162 3 года назад
it fixed my day. thanks for making this tutorial
@ivanivanov9705
@ivanivanov9705 Год назад
Very, very, VERY nice video. Thank you. Now I know how to use nav mesh agent.
@danielvillalba4457
@danielvillalba4457 3 года назад
Pretty nice explanation on the NavMesh system, thanks a lot!
@AngeloKim
@AngeloKim 3 года назад
Great tutorial! Will definitely come back to this video when I get to making the enemies in my project.
@qasimahamad5075
@qasimahamad5075 2 года назад
I'm too glad to watch this video. Thank You.
@zitongstudio
@zitongstudio 2 года назад
Thank you! All the essentials I was looking for.
@MarceloLemosRossi
@MarceloLemosRossi 3 года назад
Nice tutorial. My game is top-down with click to move. I'm going to use NavMesh and you helped a lot.
@christopherfarrell-artist3557
@christopherfarrell-artist3557 3 года назад
As always, you are informative and educational. Thank you!
@marshallross3373
@marshallross3373 3 года назад
Great demo/tutorial. Thanks for posting!
@wajeehasamreen5711
@wajeehasamreen5711 3 года назад
plz continue making this types of videos plzzzz.........😊😊😍😍
@wortwortwort117
@wortwortwort117 Год назад
I spent 3 days trying to understand how to move an enemy and was so satisfied, then I see this much MUCH easier method like bruh
@CodeMonkeyUnity
@CodeMonkeyUnity Год назад
Whatever you did, I'm sure you learned a lot so it wasn't wasted time! Keep on learning more and more things!
@zainjavaid7659
@zainjavaid7659 2 года назад
Thank You for awesome explaining!
@kozmobotgames
@kozmobotgames Год назад
This Navigation window is labeled as Obsolete in Unity 2022. How can I do NavMesh in the latest version of Unity?
@MiniFrenchAdventures
@MiniFrenchAdventures 2 года назад
Perfect explanation. Thank you so much
@jud.su.5developer895
@jud.su.5developer895 Год назад
O my god so nice I don’t know that navmesh can jump form cube to another or drop thank you so much ❤
@nguyenhuuphu8371
@nguyenhuuphu8371 3 года назад
Fascinating video. Thank you so much!
@RUDERUDYTUTORIALS
@RUDERUDYTUTORIALS Год назад
This video is really helpfull thank you very much awesome work.
@misal-isahabe5281
@misal-isahabe5281 6 месяцев назад
Thanks for this contants! See you next time!
@ameleustv3093
@ameleustv3093 3 года назад
This is a very nice and detailed video.
@Jay_Bacal
@Jay_Bacal 3 года назад
Well done!
@A_Kiwi.
@A_Kiwi. 2 года назад
tysm, this is perfect for my rts game!
@ameliapl868
@ameliapl868 2 года назад
Thank you so much!! It worked
@jean-michel.houbre
@jean-michel.houbre 3 года назад
Very clear, as usual.
@ThefamousMrcroissant
@ThefamousMrcroissant 2 года назад
Very concise. This tool seems especially useful for prototyping, but feels a little inflexible when it comes to dynamic terrain.
@dafafdsafdas8770
@dafafdsafdas8770 Год назад
very useful,thank you!
@CodeMonkeyUnity
@CodeMonkeyUnity Год назад
I'm glad you found the video helpful, thanks!
@eniocc
@eniocc 3 года назад
Very helpfull content. Thanks sir.
@gargaroots
@gargaroots 3 года назад
Amazing overview! Thanks a lot man! =)
@y01cu_yt
@y01cu_yt 11 месяцев назад
Thanks, it was nice and clear!
@StygianStyle
@StygianStyle 3 года назад
Interesting. the "official" tutorials seem to state that you need the NavMesh surface component, still in preview state, to get this working. Very confusing documentation at Unity that has caused many hours of frustration. This tutorial is great though. Thanks.
@shiv-iwnl8188
@shiv-iwnl8188 3 года назад
Hey can you please do a tutorial on how to use use the LOD component in ecs?
@alltidtratt3564
@alltidtratt3564 Год назад
Great and clear thank you 😊
@roshanthapa1297
@roshanthapa1297 3 года назад
This was very helpful 🙂.
@harrynrtnj
@harrynrtnj 2 года назад
Thank you
@Malkawi_FTP
@Malkawi_FTP 3 года назад
Oh thank you so much, That really helped
@melomaniakjm
@melomaniakjm 3 года назад
Code Monkey is the best. Thanks, again.
@Happyhenzo
@Happyhenzo 2 года назад
For some reason it won't let me use the drop height and jump distance no matter what i set the values to
@floriang7
@floriang7 Год назад
I've just watched the video to learn about Unity's navigation and I have a quick question: Currently i'm using a Rigidbody to move a character but I want it to navigate around different obstacles. Do I now use the NavMeshAgent to move the character instead of using the RigidBody?
@ivanyhw2923
@ivanyhw2923 2 года назад
Thank you!
@zildeos9858
@zildeos9858 3 года назад
Great video as always Also can you make a video for working in with the ide cause every other tutorial is taking about the text editor instead of the actual ide thanks
@trebor2485
@trebor2485 2 года назад
Would this NavMesh system work with a procedurally generated world? Is there a way to bake the spawning environment as it generates in-game?
@FarazKhanDev
@FarazKhanDev 3 года назад
WHats the difference between setting an obstacke as static, as you have shown versus adding the "nav mesh obstacle" component via inspector? Thanks
@Jason-wh3mq
@Jason-wh3mq 3 года назад
I love these tutorials! I bought your Udemy course as soon as I started this video and saw the link! Are there any plans to add a 2d pathfinding video to the course? That would help me out on a project of mine.
@CodeMonkeyUnity
@CodeMonkeyUnity 3 года назад
Thanks! I hope you're enjoying the course! I don't think Unity's NavMesh works with 2D, maybe there's an official extension but I'm not sure. Usually for 2D either I make my own ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-alU04hvz6L4.html Or use the A* Pathfinding Project ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-46qZgd-T-hk.html
@alicivrilify
@alicivrilify Год назад
I am working on an RTS, and thinking of using A* package from Assetstore. The dilemma is that should I use my own grid and things like breakpoints, or the NavMesh? NavMesh is much easier of course and fine-grained. But then my maps might get large. So, Code Monkey, do you have any idea if NavMesh is performant enough to be the goto tool in RTS games for characters walking around, chopping wood, etc. What is your experience?
@CodeMonkeyUnity
@CodeMonkeyUnity Год назад
It really depends on how big are your maps and how detailed/irregular they are, but yes in general for a RTS you do want a NavMesh The A* Pathfinding asset is insanely performant so unless you have a giant planet sized world or thousands of units I don't think you'll find many issues.
@aleksey2793
@aleksey2793 2 года назад
Hi! Which pathfinding is better for tilemap isometric game? Astar or NavMesh?
@harshadagorey
@harshadagorey 3 года назад
Nice one
@benji23245bis
@benji23245bis Год назад
Great video ! But it feels like it's made for non-player characters only ? Or is that also how I could make my player smoothly go up stairs ?
@CodeMonkeyUnity
@CodeMonkeyUnity Год назад
You can also use it for the player, either as kind of like an RTS to tell the player where to go, or just ask the NavMesh ifthe position where the player wants to go to is walkable docs.unity3d.com/ScriptReference/AI.NavMesh.SamplePosition.html
@benji23245bis
@benji23245bis Год назад
@@CodeMonkeyUnity It's weird because I replicated what you did in the video, except with a cube controlled by me, and the cube just wouldn't go up the stairs :/
@masterank2005
@masterank2005 3 года назад
Hi, I am a novice unity game developer and I am facing an Andriod Unity Webgl problem where my canvas elements are not getting fit on any android device screen even though I set the canvas scaler to scale with the screen size. I went through a lot of documents but I couldn't figure out the answer. Please help me solve this issue as I worked really hard on that game. Please Help!
@marcelothunder3772
@marcelothunder3772 3 года назад
can u make a video for baking the navmesh while in the game?
@Forjugadname
@Forjugadname 3 года назад
Really cool tutorial, I'm curious if you know of a way to use the navmesh with entities or jobs in some manner.
@CodeMonkeyUnity
@CodeMonkeyUnity 3 года назад
I did cover interaction with Game Objects and DOTS quite a while ago ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-XomlTHitAug.html It's been a while since I made that video so not sure if there's a better method nowadays.
@louisforlibertarian
@louisforlibertarian 2 года назад
Absolutely love this type of video! And I have a quick question - if I am working on a project that involves the 3d navigation of a robot in outer space, can NaveMesh still function properly?
@CodeMonkeyUnity
@CodeMonkeyUnity 2 года назад
Do you mean baking a sphere navMesh? I don't think the default NavMesh supports that, I think you would need to manually stitch multiple meshes together
@joepeters8746
@joepeters8746 3 года назад
This video is cool explaining the basics, but how to really use it? How to add e.g. an animation when it jumps from one plattform to another? How to use it with physically driven objects etc.?
@CodeMonkeyUnity
@CodeMonkeyUnity 3 года назад
In this video I focused on the basics, I plan to cover more advanced use cases in another video when I make the first course update.
@theashbot4097
@theashbot4097 Год назад
Unity has changed Nav mesh. so do you plan on updating your course?
@CodeMonkeyUnity
@CodeMonkeyUnity Год назад
Yup it's on my list, same thing with Analytics which also changed
@밥도둑-l5j
@밥도둑-l5j 3 года назад
nice work!! love it. can you make produceral 2d animation courses?
@moddyp4989
@moddyp4989 Год назад
when i click on window and ai it shows navigation and navigation obsolete but when i click navigation it only shows agent and areas and the obsolete one shows agent areas bake and object pls help
@shanmukhajagadeesh
@shanmukhajagadeesh 3 года назад
Awesome. could you please make a video on Vegetation studio pro.
@stephenmackenzie9016
@stephenmackenzie9016 3 года назад
Would be great if you could explain how to manage custom movement and animation over a link 😎
@CodeMonkeyUnity
@CodeMonkeyUnity 3 года назад
Yup, I plan to cover that and more advanced use cases in another video when I make the first course update.
@neos6997
@neos6997 2 года назад
Pro tip: if you can’t see the navmesh after baking just make sure gizmos is enabled in the scene view… 🤦‍♂️
@sundsalharbi8817
@sundsalharbi8817 2 года назад
Thank you so much, I did not know what is the wrong ! ... thank you
@Duck-ue3vn
@Duck-ue3vn 2 года назад
thanks
@AleksanderKamieński
@AleksanderKamieński Год назад
Is it possible to simulate a large number of people leaving a multi-story building using Unity navmesh pathfinding and probuilder?
@ajinkyax
@ajinkyax 3 года назад
you should bring a course on Unity 3D state machine, Im a new to unity, but having made a simple player controller and NPC, NPC needs some brain now
@Xeratas
@Xeratas Год назад
Is it good practice to make the player an agent in an isometric 3d game? For example my Player has a CharacterController that handles the general movement of my character - for example it walks to the location where i clicked. But it will not avoid objects. Would it be good idea to make my player a navagent to have pathfinding? How do navagents interact with objects that already have a charactercontroller attached?
@CodeMonkeyUnity
@CodeMonkeyUnity Год назад
Either you would use an Agent or a CharacterController, not both since they serve the same purpose (moving the object). And yes for a point and click making the player an Agent is a great way to do it
@Xeratas
@Xeratas Год назад
@@CodeMonkeyUnity damn that was a fast answer, amazing that you are always around and answer questions even on older videos. Thanks a lot, i highly appreciate that
@pliniomourao
@pliniomourao 3 года назад
How do i Bake the scene through code? Lets say i procedure generate my scene and set the static mesh of my scene... How to Bake using the code?
@EskChan19
@EskChan19 3 года назад
You can add the NavMesObstacle Component if you want things to be considered an Obstacle during runtime, that's useful for example when you build a strategy game so units don't walk through buildings you build. If you want to bake an entire navmesh during runtime then Unity can't do that by itself, but there's a plugin called High Level Navmesh Building Tools that you can download from Unity to add components that you can add to gameobjects through code to make them considered for navmesh.
@pliniomourao
@pliniomourao 3 года назад
@@EskChan19 thank you so much. I will look into the tool and make tests. Thanks
@xenoaisam
@xenoaisam 3 года назад
Ultra Advance tutorial : Unity Navmesh on Elevator :)
@shadybandit7
@shadybandit7 2 года назад
nice 👍👍👍👍
@robs5532
@robs5532 3 года назад
Is there any way to generate off mesh links for jumping up? with a max jump height? To allow agents to jump up or climb up to another mesh
@adm1n901
@adm1n901 3 года назад
I was wondering how to do this in 2D. is it possible to do navmesh in 2d or just 3d? 2d topdown specifically.
@CodeMonkeyUnity
@CodeMonkeyUnity 3 года назад
Unity's NavMesh only supports 3D, that's why for my 2D games I normally either used my own custom Pathfinding or the A* Pathfinding Project ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-46qZgd-T-hk.html ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-alU04hvz6L4.html
@adm1n901
@adm1n901 3 года назад
Thanks!
@rameshkrishnan3020
@rameshkrishnan3020 3 года назад
@@adm1n901 github.com/h8man/NavMeshPlus use this for 2d navmesh
@annakontou5584
@annakontou5584 3 года назад
In my opinion you could just turn the camera from the top so it will look like 2D.
@adm1n901
@adm1n901 3 года назад
Tysm fusion
@spartadiunruly6212
@spartadiunruly6212 3 года назад
Can you show how to make character selection in new unity input system
@shotkill4932
@shotkill4932 Год назад
hello, please tell me why NavMesh UpdateUpAxis may not work?
@liliaceae2212
@liliaceae2212 4 месяца назад
How do you increase speed without sliding too much?
@spyderhernandez
@spyderhernandez 2 года назад
Is there a way to make the player hide from the enemy using NavMeshComponent? I'm making a game where the player has to hide from the enemy which is like a warden in order to get to the end. I want to to make the player be able to hide behind walls and avoid the wardens detection.
@JoeyHauschildt
@JoeyHauschildt 3 года назад
Can you bake the navmesh at runtime? Can I change agent settings through a script?
@chtr33
@chtr33 2 года назад
There are agent settings both in agents tab and bake tab like agent radius height etc. What is the difference?
@thite2542
@thite2542 3 года назад
hello can i ask something why my navmesh can't run into clone from selected character?
Далее
Setup 3D Pathfinding Agents In Minutes Using Unity
7:41
бабл ти гель для душа // Eva mash
01:00
Ванька пошел!!!! 🥰
00:18
Просмотров 1,1 млн
Купил КЛОУНА на DEEP WEB !
35:51
Просмотров 3,2 млн
AI Boxing Got me Wheezing
15:06
Просмотров 361 тыс.
I Paid Fiverr Game Developers to Make the Same Game
10:25
Unity NavMesh Tutorial - Making it Dynamic
9:00
Просмотров 365 тыс.
I Made the Same Game in 8 Engines
12:34
Просмотров 4,2 млн
Dear Game Developers, Stop Messing This Up!
22:19
Просмотров 722 тыс.
Why Stairs Suck in Games... and why they don't have to
11:24
Unity NavMesh Tutorial - Animated Character
15:00
Просмотров 316 тыс.
бабл ти гель для душа // Eva mash
01:00