Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Go to point closest to Destination

Discussion in 'Navigation' started by NissStudios, Aug 9, 2018.

  1. NissStudios

    NissStudios

    Joined:
    May 15, 2017
    Posts:
    2
    How can I make an enemy go as close a possible to the destination even if the destination is unreachable?
     
  2. Miggi124

    Miggi124

    Joined:
    Jul 31, 2017
    Posts:
    44
    Hello there!

    As far as I know, if you use a Navmesh and Unity's build in Navigation, your AI will attempt to go as close to the set location as possible, without any extra scripting. It will just travel to the end of the boundaries and stay there...

    Regards,

    Miggi124
     
  3. newjerseyrunner

    newjerseyrunner

    Joined:
    Jul 20, 2017
    Posts:
    509
    I do a NavMesh.SamplePosition to find the closest point still on the nav mesh using.
     
    leftshoe18 likes this.