Forum rules - please read before posting.

Navmesh problem: player takes a shortcut out of the navmesh

Hello Chris,
First, thanks a lot for your continued work on AC. This plugin is just the best one and I love it so much !

I have a strange issue with Navmesh in one of my game's scenes.
I use Unity 2020.3.17f1 and Adventure Creator v1.74.2
And my game is a 2D game.

The scene looks like that :

There's a big water tank on a roof and the player can walk in front of it and behind it.
This is quite easy to do with AC with a transparent png of the tank and a sorting map.
To be sure the player and the tank won't be overlaping when the Sorting Map changes the Player's Order in Layer, I made the navmesh a bit distant from the tank, like that:

It's working fine but when I play the scene, something strange happens.
When I click next to the tank, the player takes a shortcut out of the navmesh and walks very close to the tank, like that :

And it causes overlaping problems : the player appears briefly in front of the tank when he should be behind.
You can see it in the video below:
https://youtube.com/watch?v=VPzVmrr1Bqo

I'm not sure if this is a normal behaviour or if I did something wrong somewhere.
So if you have any clue on how to solve this, it would be very helpful.
Thank you and sorry for the trouble.

Comments

  • We'll need to determine if this is caused by the Player, or the scene/settings.

    First, try raising the Accuracy slider in the NavMesh's Inspector, and also the Destination accuracy in the Settings Manager's "Movement settings" panel.

    If the issue still occurs, drop the 2D Demo's Player prefab, Brain2D, into your scene so that he overrides your default Player. Does he exhibit the same problem? If not, share screens of your Player's Inspector.

    Does your Player have Only move when sprite changes? checked? Try unchecking this if so, and/or checking Retro-style movement?.

  • Thanks a lot for your answer.
    I've tried everything you suggested but, unfortunately, it made no difference.

    I've noticed an other similar problem with the pathfinding, as illustrated in the image below:

    If the Player is standing on spot A and I click on spot B, he won't follow the expected path (yellow arrow) but take a direct shortcut (red arrow) through the Navmesh.

    I've also noticed these pathfinding problems may happen only when I click outside the NavMesh. If I click inside the NavMesh, the Player will follow the expected path within the walking area.
    (but I'm not sure about that since the problem only occurs when the player is standing in certain place and when I click on a specific place. So there may be other combinations where the problem occurs that I haven't found yet...)

    I've tried with other scenes. In most of my scenes, the NavMesh has a simple shape (like a rectangle) so there's no problem. But there's one other scene with a complex NavMesh and, there too, I've experienced the same problem: if the player is standing in a specific area and I click in another specific area, he'll walk right through the NavMesh instead of following the expected path.

    I honestly have no idea why this happens and if I did something wrong somewhere.
    I'm more of an artist than a coder so I understand very little about how AC works.

    I join below my Player's Inspector. I hope it will be of some help.

    Thanks again for your help!

  • Did the issue also occur with Brain2D?

    As the issue seems scene-specific, I'll need the scene itself to get to the bottom of it. Can you PM me the scene file to me? The background art should not be necessary, but your game's Manager and Player prefab would be good as well.

  • Yes, I had the same issue with Brain2D.
    I'm going to send you what you requested. Thank you.

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.