Search Unity

Tie the navmeshagent to the navmesh

Discussion in 'Navigation' started by EugeneVlasov, Apr 6, 2019.

  1. EugeneVlasov

    EugeneVlasov

    Joined:
    Dec 23, 2013
    Posts:
    20
    Hi guys.

    Please forgive my english.

    Please tell me if I can attach NavMeshAgent to NavMesh without rebaking NavMesh?

    In the video, the capsule moves using the CharacterController. I want to turn off the controller when the capsule reaches NavMash and transfer control of the capsule to NavMashAgent.

    Thanks for your time and your answers.
     
  2. EugeneVlasov

    EugeneVlasov

    Joined:
    Dec 23, 2013
    Posts:
    20
    Forgot to attach video.
     

    Attached Files:

    • 1.gif
      1.gif
      File size:
      310.4 KB
      Views:
      655
  3. Yandalf

    Yandalf

    Joined:
    Feb 11, 2014
    Posts:
    491
    Hmmm, you might want to try using NavMesh.SamplePosition in Update. When the SamplePosition is equal to your transform position, you turn off the CharacterController and turn the NavMeshAgent on.
     
    EugeneVlasov likes this.
  4. EugeneVlasov

    EugeneVlasov

    Joined:
    Dec 23, 2013
    Posts:
    20
    @Yandalf , Thanks!
    I will try to apply it.