Forum rules - please read before posting.

Two NavMeshes at once?

I have a 2D scene where the player is walking along an upper floor while an NPC moves along a lower floor. Originally, I used two NavMeshes that look like this:
_______
[______]
___________
[__________]

But when I started the scene, the NPC immediately walked through space up to the first floor in search of their marker. So then I tried building them as one NavMesh:
_______
[ _____]
I I_________
[__________]

Both characters moved along their path almost properly, except that all the pathfinding is now calculated through that gap. If I take my player for a walk, they squeeze through regardless of collision boxes and holes. The best luck I've had is using a trigger box to force the player away from there, but the pathfinding keeps pulling them back.

Does anyone have an idea as to how to get two NavMeshes to work at once? Or at least fake it?

Thanks

Comments

  • edited September 2016
    I use 3D so I'm not sure how much I can help. I'm sure there's a way to control AC's navmeshes and obstacles (but I can't recall right now), have you checked the manual or the video tutorials? Anyway, I'll try to do a little search. Edit: (I deleted some of comments in the post, because they were only good for 3D 8-|) 
  • Yes, I double-checked the tutorials and manuals, though I may have overlooked a toggle since my collision boxes still aren't working.

    Another solution would be figuring out how to make the NPC walk around without a NavMesh, so I'll dig into that a little today.
  • Update: So using paths for the NPC might be a workaround. It just needs a lot of extra programming to have him perform functions and move between paths. I'm still open to other suggestions if there's a better way to make the pathfinding work.
  • edited September 2016
    Unfortunately, due to the way Unity's PolygonColliders2D works, having two separate NavMeshes active at once is not currently possible.  It is, however, something I would like to see solved - so I shall see if there is a way to get around the limitation.

    In the meantime, if the bottom area is the literal rectangle that your diagram suggests, you may be able to do without pathfinding for the NPC - the Character: Move to point Action has the ability to do without pathfinding, which will cause them to move in a straight line to their destination.
  • I tried it without "Pathfind?" checked and the NPC just stood there. Maybe I need to try it with a few other options turned off. I'll give that another go and see what I missed.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.