Forum rules - please read before posting.

Navmesh holes not working, player walks right through

I found a few discussions on this topic but none of the answers solved my issue.

I created a test scene by following the AC 2D game tutorial & can't figure out why the holes in the navmesh aren't working -- they seem to look just how they should (when entering Play mode & switching to Scene view) and all the properties seem correct. I wondered if it was my Player, but all its properties seem correct as well.
Everything is hooked up how it should be based on the tutorial. Still, my character walks right through it.

The sorting map works fine (was created after I took my screenshots but still have the hole problem, sorry) as does everything else, really happy with it but this problem has me pulling my hair out. I just know the answer's going to be really simple... Please help! 


image
image
image

Comments

  • Welcome to the community, @ShadyBee.

    From the looks of the screenshots, it actually looks like the NavMesh is working - you can see that the NavMesh has incorporated the two hole meshes into the base mesh.  Which version of AC are you working with?  If it's quite old, try updating AC to see if that fixes it.

    What is your game's scale set to?  Is the size of the background artwork comparable with that of the 2D Demos?  If not, it may be that you have to adjust your Destination accuracy slider in the Settings Manager to reflect that.

    It could instead be an issue with your player character, in that their origin is not at their feet correctly.  Try enabling "Gizmos" in the Game window to see what their true position is at all times.

    Also, try dropping in the 2D Demo's player prefab, Brain2D (found in /Assets/AdventureCreator/2D Demo/Resources) into your scene and then run it again.  If it then works well with him, we'll know that there's an issue with your player.
  • Thanks for the quick reply, this really helped! Since Brain2D had the same problems I looked closer at the scene while in Play mode, and it turns out that the hole is just too small.
    The origin at the Player's feet goes right to the edge of the hole and so his feet stick out into it, but after making the hole larger this is no longer the case.

    So it's actually working perfectly, I just didn't account for how wide my sprite is.

    Thanks again!

    image
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.