Forum rules - please read before posting.

2D Game NavMesh Hole problem

edited January 2015 in Technical Q&A
Hello everyone,

I am working on a full 2D Adventure Game and I want to start by saying Adventure Creator is a great tool and asset.

I have a problem with NavMesh2D, when I add a hole in the middle. If the user clicks inside that hole, the character gets stuck in animation movement action and doesn't stop like it does on the edges of NavMesh2D. 
Also the main character doesn't go around the hole, by calculating new path points, like it does when it moves around the edges of NavMesh2D, but simply slides off of it. Are there any solutions to this?

If it requires custom pathfinding code, where should I start with this?
I am using AdventureCreator Version 1.41b, and Unity version 4.6.1f1

Thanks in advance.

Comments

  • Custom code shouldn't be necessary - holes should work as you expect.

    The intended workflow is:
    • Create your default (i.e. main) NavMesh2D as normal
    • Create a new PolygonCollider2D (a separate GameObject) to define the hole
    • Assign the hole in the default NavMesh2D's Inspector
    When run, you should see that the "hole" PolygonCollider2D is marked as Is Trigger, placed on the Ignore Raycast layer, and it's points have been incorporated into the NavMesh2D.  Is that all working correctly?
  • Thanks for the response. 
    The problem was mine. The GameObject I created for the Hole wasn't in the "Ignore Raycast" layer. Now it works as expected. Awesome.
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.