Forum rules - please read before posting.

Problem with creating a hole in my Polygon Collider Navmesh

edited June 2014 in Technical Q&A
Hi,

I tried to create holes in my Navmesh but I can't get it to work. Not sure if it's a bug or if I'm missing something. Here are the steps I've taken to recreate the issue in the 2D demo:
1. I created a new empty GameObject. Then I added a Polygon Collider 2D to it and called it HoleTest:

image

2. Then I go the existing NavMesh2D, add 1 hole and specify HoleTest:

image

3. Then I press play to test. Brain completely ignores the hole I just created. I set destination accuracy to 1 but it didn't change anything. 

Any help is greatly appreciated!

Comments

  • That's the correct workflow, but it doesn't work for me either.  Used to - can't see why it's not.

    Will investigate.
  • Fixed for 1.36.  It only occurs when the NavMesh object is not at the scene's centre.

    In the meantime, you can make the code fix yourself by editing NavigationMesh.cs, and changing line 50:

    From:
    newPoints.Add (hole.transform.TransformPoint (holePoint));

    To:
    newPoints.Add (hole.transform.TransformPoint (holePoint) - transform.position);
  • Ok, will do. Thank you for solving this so quickly!
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.