playMaker

Author Topic: Calculated Nav Path is impossible  (Read 953 times)

2501

  • Playmaker Newbie
  • *
  • Posts: 14
Calculated Nav Path is impossible
« on: October 19, 2021, 06:14:36 AM »
Hi

So I have this test scene with two platforms. Both have a nav mesh, but they are separated by a gap. Still, NavMesh calculates a path, tells the Agent that it's a valid path and sends it on the way. It reaches the edge and of course stops there.

Actions I use: Nav Mesh Calculate Path (also tried the "between GameObjects variant, same result) and just to be sure "Get Agent Path Status".

How can that be a valid path? I assume there's something I don't get or really misunderstood... but I need to check if the destination is actually reachable, before showing a grid there.

I'm grateful for any help.


J.

« Last Edit: October 19, 2021, 06:59:30 AM by 2501 »

2501

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Calculated Nav Path is impossible
« Reply #1 on: October 24, 2021, 03:26:30 PM »
So either my description was to cryptic or no one could help. I couldn't find any working solution per googling around. Or I still don't get something. It seems like NavMesh just reports the last reachable position and gives the thumbs up. Doesn't make sense to me, but okay.

So here's my workaround, in case another newbie needs it: I take that last reported position and compare the vector3 with my desired destination. If they are reasonably close to each other (< 1) than it's a valid path.

Maybe obvious to some, but it took me a while to get there  ::)

J.

blackant

  • Hero Member
  • *****
  • Posts: 521
  • http://blackantmaster.com
    • blackantmaster.com
Re: Calculated Nav Path is impossible
« Reply #2 on: October 26, 2021, 04:16:59 AM »
Did you set the Jump Distance parameter ?

2501

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Calculated Nav Path is impossible
« Reply #3 on: October 26, 2021, 08:39:01 AM »
It's set to 0, since jumping is not an option for now.


J.

Twood

  • Junior Playmaker
  • **
  • Posts: 76
Re: Calculated Nav Path is impossible
« Reply #4 on: October 27, 2021, 02:16:14 AM »
So here's my workaround, in case another newbie needs it: I take that last reported position and compare the vector3 with my desired destination. If they are reasonably close to each other (< 1) than it's a valid path.

Yep this is how I solved that same thing. Working with unity nav is full of weird (seemingly broken features) that you have to workaround by using some correct logic in PM.

Other weird bug with unity is if you want the real exact remaining path distance, NavMeshAgent.remainingDistance returns infinity all the time if it's "unknown." How they have their own feature get an unknown result all the time, I dunno because that's not useful. So instead you have to add the distance between the character and then the remaining nodes yourself, which should work fine.

Also it has no fleeing or group AI behaviors, whatsoever, so be ready for a lot of fun having to add major AI systems from scratch if you need more.