NavMesh Basics - Introduction to the NavMeshSurface | AI Series Part 1 | Unity Tutorial

Поделиться
HTML-код
  • Опубликовано: 17 дек 2024

Комментарии • 109

  • @diliupg
    @diliupg 3 года назад +23

    This is easily the most comprehensive and up to date Navmesh Tutorial series on RUclips. I am going to share this on Facebook and Twitter. I Wish you good luck and hope you get many subscribers. Thank you for sharing this knowledge with the world.

    • @LlamAcademy
      @LlamAcademy  3 года назад +1

      🙏🤗 Thank you! I appreciate your kind words and that you are sharing it with others so they can learn as well!

  • @akashjaiswar9437
    @akashjaiswar9437 Год назад +1

    I love how you say, "Here to help you, Yesss you." I will be honest at first it was weird but now I love it. Thanks for all the awesome techniques and knowledge.

    • @LlamAcademy
      @LlamAcademy  Год назад +1

      😁 it’s my favorite part of every video

  • @deepanchakravarthy4381
    @deepanchakravarthy4381 Год назад +1

    The Best AI series in all of youtube for UNITY. Thank you sir.

  • @beng2620
    @beng2620 Год назад +2

    Omg THANK YOU SO MUCH! This AI series is the thing I need urgently to getting employed. I need to design a navmesh system with various types of enemies and players. Flying navMeshagents, spawning enemies, shooting, attackking etc. And it looks like everything I mentioned is in this series. You are my savior!

  • @benigodx
    @benigodx 10 месяцев назад

    I'm glad I found your AI series on RUclips. Thank you.

  • @benigodx
    @benigodx 10 месяцев назад

    I'm glad I found your AI series on RUclips. Thank you.😁

  • @K.Z007
    @K.Z007 Год назад +1

    Saw your NaMesh series, must leave a like. Thank you.

  • @Lskiku
    @Lskiku 3 года назад +3

    Excellent, greetings from Germany. Great job. Thanks for seperating the video in the different sections. Go on like this, appreciate the work!

    • @LlamAcademy
      @LlamAcademy  3 года назад

      I'm grateful to have helped you!

  • @RadonaOfficial
    @RadonaOfficial Год назад +3

    Your tutorial is very easy to follow. Thank you very much

  • @fauzannrifai
    @fauzannrifai 3 года назад +1

    I jump to part 14 then I wonder where the navmeshsurface came from 😂️, now here I am. Thank you so much

  • @EdzioListonosz290
    @EdzioListonosz290 3 года назад +1

    Nicely explained, will definitely follow along the tutorials

    • @LlamAcademy
      @LlamAcademy  3 года назад +1

      Thank you! I hope the series helps you develop your game!

  • @CariagaXIII
    @CariagaXIII 2 года назад

    the entire tutorial is better than trying to make sense of other path finding algorithm.. i just hope unity makes navmesh better for rts,turn based,dynamic navigation,2D navigation and flying

    • @LlamAcademy
      @LlamAcademy  2 года назад

      Thank you 🙏! I also hope there are some improvements coming to the Navigation system. It’s pretty good but there are some use cases that it does not cover.

  • @dimavavilov7737
    @dimavavilov7737 2 года назад +1

    thank you so much for that detail video!

  • @paulberry3359
    @paulberry3359 2 года назад +1

    Just came across your channel, wow this looks amazing following along for sure.

  • @thnknde
    @thnknde 3 года назад +1

    If RUclips had a button to weigh display of channels on a topic yours would be at the top my dude. NavMesh has been rubbing me the wrong way and I'm super excited to have it rub me the right way. :]

    • @LlamAcademy
      @LlamAcademy  3 года назад

      I'm flattered! Thank you for the praise!

  • @AaronAsherRandall
    @AaronAsherRandall 2 года назад +1

    Thank you so much for this tutorial! I just set up everything as you did, in pro builder as well! Looking forward to going through the series!

  • @monkeymonkey69696
    @monkeymonkey69696 2 месяца назад

    yoooo you are my fav bro ever Let's goo

  • @TheShittyBeatles
    @TheShittyBeatles 2 года назад +1

    Just getting started with your videos, you're quickly becoming one of my favorite. Thank you so much. Whats the difference between including com.unity.ai.navigation via git rather than through the package manager?

    • @LlamAcademy
      @LlamAcademy  2 года назад

      Awesome 😎 thank you!
      Today I would recommend using the com.unity.ai.navigation package via the package manager because you can easily upgrade to the latest version using the package manager.
      When I first made this video it was not supported like that yet so this was the easiest way to install it!

  • @alextrollip7707
    @alextrollip7707 3 года назад +1

    I'd maybe add in the next video in the series in the description.
    For some reason RUclips isn't suggesting it as the next option to play as it usually would for playlists.
    Making it easier for people to find the next video means you'll keep them interested longer.
    You'd be surprised how lazy people can get.

  • @candycodes4575
    @candycodes4575 3 года назад +2

    Wonderful tutorial.
    Wonderful tutorial. Glad I bumped into this video.
    Just started watching the series, I like that you give an initial overview/highlights of the topics to be covered before actually diving into the tutorial. :D
    Would it be possible to combine this with rigidbody though? Just use the pathfinding part, but not have it control the model?

    • @LlamAcademy
      @LlamAcademy  3 года назад

      I'm glad you found the series too! Can you elaborate on what you mean at the last part of your comment about using pathfinding without having it control the model? I'm not sure I understand your question entirely.

    • @candycodes4575
      @candycodes4575 3 года назад +1

      @@LlamAcademy
      I'll try to describe it best I can.
      Having the navmesh compute a path towards the target/objective/quest.
      But the model doesn't move since it's being controlled by rigidbody w/ controller input (not by navmeshagent).
      Basically movement controls are like Monster hunter or Zelda games. (which is not point and click)
      But use the navmesh pathfinding to basicaly always route the best route towards the goal based on player position.
      (Because I plan to render the waypoints/path along the ground, where the player can opt to follow or not.)
      I hope i described it better. :D

    • @LlamAcademy
      @LlamAcademy  3 года назад +1

      Ah okay I think I understand. I don't have a video specifically about that, but you can use the path calculation done here ruclips.net/video/BFT8Fa4ZsMk/видео.html and render your waypoints or the path based on the corners returned from that calculation. I'll add this topic to the list though! Great question

    • @candycodes4575
      @candycodes4575 3 года назад

      @@LlamAcademy Yes, nice. That is very helpful. :D
      I guess I should have waited to finish the series before asking any questions. Thank you for the help. :D

    • @LlamAcademy
      @LlamAcademy  3 года назад +1

      No need to watch them all before asking a question! There's a lot of hours of tutorials in the series already. Asking for help to get to the right one is totally okay!

  • @enricc.r.8313
    @enricc.r.8313 3 года назад +3

    Nice videos, really! They are detailed and not just a brief intro of matter. BTW, the intro "yes you" is a bit cheesy, no offense intended.

    • @LlamAcademy
      @LlamAcademy  3 года назад

      None taken. Glad you are getting value from the videos!

  • @maitrykotak3703
    @maitrykotak3703 7 месяцев назад

    this is awesome...here if v want multiple enemies like in shooter games....than how to d0 that?...is there any video for that is availabel?

    • @LlamAcademy
      @LlamAcademy  7 месяцев назад

      Yes, that is covered in Part 5 in the series: ruclips.net/video/PoglGJoDcZg/видео.html

  • @BatuhanTerzi1
    @BatuhanTerzi1 2 года назад +1

    Amazing tutorial, thanks to you to sharing what you know, I have an issue that I couldnt see in the comments, I can't see and add the navmeshsurface component in my unity editor. Is it because that I use package manager to download ML agents?

    • @LlamAcademy
      @LlamAcademy  2 года назад +1

      You should add the NavMeshComponents to the manifest.json file like it is done here: github.com/llamacademy/ai-series-part-1/blob/main/Packages/manifest.json then it should update and the components should become available. If you're using Unity 2022 I think it is available on the package manager itself

    • @BatuhanTerzi1
      @BatuhanTerzi1 2 года назад +1

      @@LlamAcademy thank you for your quick answer and kindness, I am using 2020 and I'll add navmeshcomponents to json file

  • @AletseDev
    @AletseDev 2 года назад +2

    have some way to put navmesh on curve like cave? or its only for flat objects?

    • @LlamAcademy
      @LlamAcademy  2 года назад +1

      You can have non-flat objects. How steep of curves/inclines that the NavMesh will bake for is determined by the NavMeshAgent's Max Slope parameter in the Navigation Window. Small objects can also be stepped over and this is driven by the Step Height parameter in the Navigation Window.

  • @PhilBoswell
    @PhilBoswell Год назад

    I would love to binge this series but the playlist is for some reason in reverse order: if you could fix that I would be much obliged, and no doubt I would not be alone!

    • @LlamAcademy
      @LlamAcademy  Год назад +2

      I had the latest first because people tended to be more interested in the recent videos, but I can see watching it in that order would be silly. I've flipped it back around so the playlist starts on episode 1

  • @Ankh_Ramses
    @Ankh_Ramses 3 года назад +2

    Will the enemy automatically select the fastest route to the destination, or can we control that some way? And can we make a prefab always unwalkable, instead of having to slect each piece and making them unwalkable? By the way, thanks for the series

    • @LlamAcademy
      @LlamAcademy  3 года назад

      They will pick the shortest path to the target.
      You can absolutely make a prefab to be unwalkable all the time. You just set it up like any other component and reuse that prefab to be labeled as "Not Walkable" and when you bake the NavMesh, it will be not walkable!

  • @DrewofDonuts
    @DrewofDonuts 3 года назад +1

    Hi! Series looks like it could be really great (obviously just starting here). I cannot figure out why my nav mesh agents are going through my obstacles.
    •The agents and obstacles both have non-trigger colliders.
    • I do not have Ignore From Build enabled in the Modifier
    • Nav Mesh Obstacles solves the issue, but YOUR obstacles do not seem to have that component, yet the walls are not passable.
    Insight would be appreciated!

    • @LlamAcademy
      @LlamAcademy  3 года назад +1

      Hmm hard to say without being able to see your scene but a few ideas for possibilities:
      ⚫ NavMeshSurface is configured to use MeshRenderers and your obstacles only have a collider
      ⚫ Obstacles are on a different layer that is not considered by the NavMeshSurface
      ⚫ NavMeshSurface is Collect Objects children and obstacles are not a child of the Surface
      Hopefully it's one of those or they at least get you going in the right direction!

    • @NunSuperior
      @NunSuperior 3 года назад

      I ran into this issue too. It looks like we have to bake the old Unity navmesh one time (ever?) or the new component surfaces won't get applied. Window > AI > Navigation > Bake tab and press Bake. After I did that my agents avoided walls, and I could add new walls, rebake the new NavMesh surfaces, and the agents will avoid the new walls.

  • @jakobjenbo8780
    @jakobjenbo8780 3 года назад +1

    based on my prier speed at follow tutirals this should only take around 8 hours but it looks like just what i was looking for :D

    • @LlamAcademy
      @LlamAcademy  3 года назад

      Have fun going through the series!

  • @kpro9047
    @kpro9047 3 года назад +1

    Great tutorial. You should have more subscribers and likes! But agree with others...better to change up your catch phrase.

  • @m7mdaqu542
    @m7mdaqu542 3 года назад +1

    Thank you for this series. I was wondering if you could make a video about a crowd of Agents and prevent them from bumping into each other in an attempt to reach the target site completely, and stopping the noise when they can't reach the same position exactly (because they are a crowd).
    Also if you could make a video about how to spread the crowd of Agents to make them reach to same target position but in a different way (path).
    thanks again :)

    • @LlamAcademy
      @LlamAcademy  3 года назад +2

      Thank you for the suggestions! Both of those are complex topics I'll have to research some more to see how those can be achieved. Once I can figure them out, I'll share that knowledge in the form of a tutorial.

    • @m7mdaqu542
      @m7mdaqu542 3 года назад +1

      @@LlamAcademy Thanks for your effort, keep going

  • @shaikhabdulbasit5717
    @shaikhabdulbasit5717 2 года назад +1

    Hey chris, I have an issue, if the target is not on the navmesh, then the agents just stop moving, i want them as much as they can

    • @LlamAcademy
      @LlamAcademy  2 года назад +1

      It’s hard to say which option would be best, but I think you can try a couple of things.
      If the target is close to a NavMesh you can use a NavMesh.SamplePosition docs.unity3d.com/ScriptReference/AI.NavMesh.SamplePosition.html at the target position with a relatively large radius and it will find a spot on the NavMesh.
      You could also try NavMesh.FindClosestEdge(). I’m not sure if this works from a Source Point off the NavMesh though. docs.unity3d.com/ScriptReference/AI.NavMesh.FindClosestEdge.html

    • @shaikhabdulbasit5717
      @shaikhabdulbasit5717 2 года назад

      @@LlamAcademy hey, thanks for replying I was thinking of doing something with samplePosition too

  • @random_precision_software
    @random_precision_software 3 года назад +1

    Hey Ive just been told about your channel, I need Advanced AI tuts.. Ill look forward to watching your videos!

    • @LlamAcademy
      @LlamAcademy  3 года назад

      If I haven't covered some specific topic please let me know and I'll add it to the planned video list!

    • @random_precision_software
      @random_precision_software 3 года назад

      @@LlamAcademy yea it's AI with patrol, attack and flee and hide, using characters you mixamo , I'm doing it but it's very Buggy. It'll great if you could do it.

    • @LlamAcademy
      @LlamAcademy  3 года назад +1

      That sounds like the state machine AI. Part 3 and 11 are probably are the two key ones for you to check out.

    • @random_precision_software
      @random_precision_software 3 года назад

      @@LlamAcademy thnx.

  • @CB66941
    @CB66941 25 дней назад +1

    - 55 videos
    Well, as someone who has made 2 mods, no one said learning game development was easy. But it definitely is going to be exciting.

  • @hsmyv
    @hsmyv 2 года назад

    Hello LIamAcademy, I started learn Unity AI and NavMeshAgent. I think at the end of series I will gain a lot of AI skills.

    • @LlamAcademy
      @LlamAcademy  2 года назад

      Lots of content! I hope you learn a lot!

  • @CassiusJohnAdams
    @CassiusJohnAdams 3 года назад

    Thanks for the tutorial. I'm wondering why we'd use two navmesh and two agent types in your example?

    • @LlamAcademy
      @LlamAcademy  3 года назад +4

      In this tutorial it's a trivial difference and you could absolutely keep them on the same NavMesh and have only a single agent type, especially since towards the end they end up being almost the same.
      The main purpose of the different agent types is to change how they will path. If there's no need in your game to have different pathing abilities per player/enemy you can and should keep only 1 nav mesh and only 1 agent type, adjusting only the parameters on the NavMeshAgent component. That will lower the size of your build and make NavMesh interactions simpler.
      In this video I wanted to showcase how you do set up different agent types and NavMeshes because the following videos in the series get into more meaningful differences in agents

    • @CassiusJohnAdams
      @CassiusJohnAdams 3 года назад +1

      @@LlamAcademy Ahh, I see. That all makes sense. Thanks for the quick reply! These tutorials are timed well for my current development phase :)

    • @LlamAcademy
      @LlamAcademy  3 года назад

      Excellent! Glad these can help your project!

  • @DishonoredSkull
    @DishonoredSkull 29 дней назад

    Is there a way to make the navmesh plane when baked to work on spheres or capsules?

    • @LlamAcademy
      @LlamAcademy  23 дня назад

      You can have Spheres and Capsules protruding out of the ground, but the ground needs to be relatively planar. If you have a spherical level I don't think it works well.

  • @neilfosteronly
    @neilfosteronly 2 года назад +3

    Easy way to get navmeshsurface is to add package by git URL and type "com.unity.ai.navigation"

    • @LlamAcademy
      @LlamAcademy  2 года назад +1

      Great tip! This makes it a lot easier to do where you don't have to manually update the manifest.json file

  • @pukarsh
    @pukarsh 3 года назад +1

    I'm just getting into AI pathfinding. Some people have also recommend A* to me, do you have any ideas on the pros and cons of using NavMesh Vs A*? Currently I'm building a 2d game but it'd be good to understand generally what both are good for

    • @LlamAcademy
      @LlamAcademy  3 года назад

      That's a great question. Under the hood the NavMesh system uses A* (docs.unity3d.com/Manual/nav-InnerWorkings.html ). I've never personally used an A* Asset to do navigation because the NavMesh system has always been able to fulfill my needs.
      The 2D game NavMesh is a great idea for me to look into and maybe make a video on. I've actually seen many people say you cannot do this, and some say you can. I suspect it works more or less the same but I've never tried making a 2D NavMesh.
      Sorry I can't fully answer your question.

  • @MENDIETA1603
    @MENDIETA1603 3 месяца назад

    Hello, do I have to install the navmesh package like it is shown in this video or can I now install it from the package manager? I see there is a package now named AI Navigation and has the navmesh surface but I cannot select "children" as collectable object like its shown in this video. I'd appreciate an update on this topic. Thank you!

    • @LlamAcademy
      @LlamAcademy  3 месяца назад +1

      You SHOULD use the package manager version now! The value for "Children" has been renamed to something like "Current Object Hierarchy"

    • @MENDIETA1603
      @MENDIETA1603 3 месяца назад

      @@LlamAcademythank you!. I was stuck because of that yesterday. I will try it now

  • @endgamedevs
    @endgamedevs 2 года назад +1

    So unity says is all experimental and not for release. Can we still use all these nav mesh features in a game? I don't mind taking the risk. I am just wondering if Unity will not let me build a release apk because of it. Don't want to spend time into this, if it won't let me publish a game.

    • @LlamAcademy
      @LlamAcademy  2 года назад

      Yes you can use it in a released game. I launched a game in 2020 using these NavMesh Components without issue.

  • @brunoperkovic3085
    @brunoperkovic3085 Год назад

    I have question regarding performance.
    Context:
    - Lets say I want to simulate 100-1000 enemies chasing player
    - They can overlap
    You put the navigation under IEnumerator with delay of 0.1s. That is roughly every 5-6 frames if I go for the 60fps. How pricy is usage of IEnumerator here? Switching context 10 times per enemy per second seems like a lot of overhead. How would you approach my situation?
    I was thinking about:
    1. maybe making bigger delay
    2. using local variable to count how many frames or time has passed and then do it each time when treshold has been reached. That would remove IEnumerator overhead.
    3. I will later integrate ECS if necessary

    • @LlamAcademy
      @LlamAcademy  Год назад +1

      I used this approach in a game with 100-200 enemies that chase the enemy on mobile and on lower end devices there became an issue. What I ultimately did was refactor it to have a single class that tracked "Alive Enemies" and set the destination on each one using the Job System. The methodology implemented in this video is good for learning and can even be implemented without significant consequence in games without hundreds of AI running around.
      In AI Series Part 40: ruclips.net/video/dHLNqbKrJdg/видео.html I cover line of sight checking with the Jobs System that is easily translatable to setting the destination as well.

  • @taylorowen9144
    @taylorowen9144 Год назад

    In 2021 LTS build, when running the scene nothing is happening when mouse0 is pressed for the player entity to move across the NavMesh.
    EDIT: I am VERY smart and had an "Update" spelled "Udpate".
    This works in Unity 2021. Thank you for the guide!

    • @LlamAcademy
      @LlamAcademy  Год назад +1

      Are you using the new input system? If you don’t have the old system enabled in the project settings it will not work and will give you a bunch of errors or warnings

    • @taylorowen9144
      @taylorowen9144 Год назад

      @@LlamAcademy I did not see you replied, but I amended my comment with an edit. Thank you for the speedy reply however! The video was great and informative, I'm just a dunce and misspelled Update as Udpate on a private void update and it wasn't caught, lol.

    • @LlamAcademy
      @LlamAcademy  Год назад

      😁 no problem. The typo gets us all sometimes

  • @pspeasant6220
    @pspeasant6220 2 года назад

    So i am trying to get the navmesh components in my projects but i cant get it to work, it keeps saying the package name is invalid, any idea how to solve this i ahve beens tuck on this for so long its making me go crazy, is it because you also need ai.naviagation? cuz i cant seem to install that bcs its telling me to use the add by name method, but that option is not appearing it all.

    • @LlamAcademy
      @LlamAcademy  2 года назад

      Did add the dependency to the manifest.json? It should look like this: github.com/llamacademy/ai-series-part-1/blob/main/Packages/manifest.json

  • @hafsasheikh9511
    @hafsasheikh9511 2 года назад

    Hi! Thanks for this tutorial series...
    I faced an issue..... When i set enemy set destination in coroutine under while loop my unity stopped responding.... So i fix it by typing that LOC in Update.....

    • @LlamAcademy
      @LlamAcademy  2 года назад

      It's really important you include that next line "yield return Wait;" or it will freeze your Unity!

  • @brianpangburn5573
    @brianpangburn5573 2 года назад

    For the life of me in script after adding Nav mesh components package, when I try NavMeshSurface, I get missing Namespace

    • @LlamAcademy
      @LlamAcademy  2 года назад

      When you try to add the surface in the Inspector does it show up? Or there are compilation errors?

  • @mohokhachai
    @mohokhachai 10 месяцев назад

    GDC will be the meeting

  • @Youshisu
    @Youshisu 2 года назад

    tutorials for 2019 in 2021 wow

    • @Youshisu
      @Youshisu 2 года назад

      ok, i actually installed the package ni 2021

    • @LlamAcademy
      @LlamAcademy  2 года назад

      Remember that LTS versions for a year come out in the following year. In 2021, Unity 2021 was in tech stream, meaning it was not stable and not ready for production use. In 2021 at the time of making this video, Unity 2019 was the latest LTS release because 2020 LTS was not yet released.

    • @Youshisu
      @Youshisu 2 года назад +1

      @@LlamAcademy its working now, i just had "debug" tab instead of inspector, but I finally managed to bake multiple navmeshes :D

    • @LlamAcademy
      @LlamAcademy  2 года назад

      Awesome!

  • @NelsonZavala0509
    @NelsonZavala0509 2 месяца назад

    are you going to see me ? in the next Video (waiting for your answer, Yeees Youuu)

  • @Rehd66
    @Rehd66 Месяц назад

    Why have music when you're talking? Why?

    • @LlamAcademy
      @LlamAcademy  Месяц назад

      You're right. In this video the music is too loud.