AI Navigation 2.0 - NavMesh links and obstacles

Поділитися
Вставка
  • Опубліковано 15 гру 2024

КОМЕНТАРІ • 21

  • @GrayFoxware
    @GrayFoxware 2 дні тому +3

    I dont know who is running unity's youtube channel but God Bless them! They are doing a great job with all these tutorials.

  • @Utamaru56
    @Utamaru56 3 дні тому +4

    Is there a way to make agent smoothly transition from one surface to another using link? That transition on 09:33 looks abrupt.

    • @DadDoesCode
      @DadDoesCode 3 дні тому

      Yea I was wondering the same thing, kind of just brushed over that it by default looked pretty terrible. Probably would have to tweak things similar to the platforms example previously shown with the AgentLinkMover class.

    • @SandorClegane-TheHound
      @SandorClegane-TheHound 3 дні тому

      Mathf.lerp is your friend
      Learn this and you can smooth anything

    • @CreativeMediaTutorials
      @CreativeMediaTutorials 5 годин тому

      On line 58 of the AgentLinkMover script the speed is set using agent.speed, change this to use a float variable of speed that you can set in the inspector. Now you can adjust the speed to smooth the movement across the off mesh link.

  • @dotcom4389
    @dotcom4389 4 дні тому +6

    good job. 👍

  • @somissesse3135
    @somissesse3135 4 дні тому +7

    Nice

  • @arnesso92
    @arnesso92 3 дні тому +4

    Nice vertical navmesh ;) I have tried connect ground and vertical navmesh but i havent figured out yet. Is there a way or trick?
    Navmesh link does not work.

    • @SandorClegane-TheHound
      @SandorClegane-TheHound 3 дні тому

      It does work
      You have to tell it to do so with further code representing the change in y direction
      Your agent needs to be told its changing its direction
      If you have a rigidbody contained
      That needs changing
      If your agent is using update code to move it needs a bool to switch its axis
      Etc etc

  • @SandorClegane-TheHound
    @SandorClegane-TheHound 3 дні тому

    Hold ctrl when rotating on an axis to snap to a degree
    Half circle
    Quarter circle are easy to define correctly without needing to type in 90 or 180
    Or just type them into the inspector

  • @____5461
    @____5461 4 дні тому +5

    Cool

  • @66ogg
    @66ogg 4 дні тому +3

    Nice❤

  • @johannswart9859
    @johannswart9859 4 дні тому +7

    Could we have a tutorial where if we have different ground materials the AI will priorities to walk on the faster path? Meaning we have a grass material and a concrete path material the AI will rather walk on the concrete.

    • @v0ltdev
      @v0ltdev 3 дні тому +4

      Thats what area costs are for, they are going to talk about that in the next video

    • @johannswart9859
      @johannswart9859 3 дні тому +1

      @@v0ltdev Thank you.

  • @pokmankameli1988
    @pokmankameli1988 6 годин тому

    Are we going to have DOTS Compatible version?

  • @onlyoneunlucky4553
    @onlyoneunlucky4553 3 дні тому +1

    Is there some performance disadvantage to dynamic obstacles?

    • @mrzaphkielYT
      @mrzaphkielYT 3 дні тому +1

      As i know no, since you carving out the hole from the navmesh and it act as a navmesh obstacle. However if you rebake the whole navmesh to create the hole on the navmesh that can be resource heavy for the scene. For example if you have the same box as in the video that you can pick up and throw and whenever it touches the ground the navmesh get rebaked:
      using UnityEngine;
      using Unity.AI.Navigation;
      public class BakeNavMeshRunTime : MonoBehaviour
      {
      public NavMeshSurface surface;
      void OnCollisionEnter()
      {
      surface.BuildNavMesh();
      }
      }
      If you have lots of agents and big scene the script above can cause some performance issues especially if the code runs from multipe objects like the box shatters and each box pieces rebake the whole navmesh surface each time it touch the ground (or anything). I belive they will cover this topic in the next video where they mentioned the dynamic navmesh creation at 9:42.
      I mainly use this technique when said random layout created and i need to create a navmesh for it. It also should be behind a loading screen so the player will not see anything from it.

    • @SandorClegane-TheHound
      @SandorClegane-TheHound 3 дні тому

      If you load asynchronously whilst something else is happening to the client youll be able to dynamically change navmesh across an entire scene quite quickly
      Unless you have thousands of small obstacles I can't see the impact on performance being too intensive
      10 to 50 objects of varying sizes should be fine
      More than that you'll need to look into dots
      Which is advanced programming

  • @RustGamestudio
    @RustGamestudio 3 дні тому +1

    Nice