Forum rules - please read before posting.

Using 2 nav meshes to seperate characters

edited September 2020 in Technical Q&A

Hi. I'm using AC 1.71.8 with Unity 2019.2.10f1, making a 2d game.

I'm trying to use the 2 nav mesh feature (on page 78 of the manual)

to have my player character in one (small) nav mesh and an NPC in another, larger nav mesh. It's not working. :neutral:

Instead the player character pops out of the small navmesh (see image https://imgur.com/prpF3sT) and then goes on a random walk around the screen, (generally until he stumbles into a trigger set for later in the game and electrocutes himself! (not relevant))

The weird thing is, when I set the other nav mesh as the default (which I switch to later after the player has climbed down) the player stands in the right position.

Any ideas why this might be happening?

I followed the instructions to create the double nav mesh - namely by adding a second polygon collider 2d to the navmesh game object. The top one in my inspector is the small nav mesh, the 2nd one the large navmesh. The PlayerStart Marker is positioned inside the small nav mesh.

(The inspector properties for the 2 collider navmesh are here: https://imgur.com/8knKOsQ)

Thanks.

Comments

  • I would need to experience the issue on my end.

    Can you PM me a .unitypackage file of the scene, together with your eight Manager assets?

    Please also let me know your AC and Unity version numbers.

  • Recreated, thanks for the PM.

    This issue is related to character evasion when using NPCs on a 2nd NavMesh.

    I shall work on a fix for the next release, but in the meantime you can get around it by setting your NavMesh's Character evasion setting to None. This can be disabled in any case, as your NPCs and Players do not share the same NavMesh.

  • Aha. OK. You're welcome.

    you can get around it by setting your NavMesh's Character evasion setting to None.

    I've done that, and the player character still won't stand in its nav mesh,
    but I'm happy to wait for the next release.

    Thanks.

  • the player character still won't stand in its nav mesh,

    Can you elaborate? The package you sent me had no such behaviour.

  • Of course:

    When I change the Nav Meshes Character Evasion to none, the player character now stays within a shape with a volume the same as the navmesh - it will no longer wander to the other nav mesh -

    but it is transposed upwards by approximately 0.6 Unity measures in the Y direction.

  • edited September 2020

    So, the same issue as your first screenshot in the original post?

    This was not reproducible in the package you sent.

    Your PM mentioned that your stripping down of your OnStart cutscene stopped this from happening. Is this now occuring after such stripping, or before?

  • This was not reproducible in the package you sent.

    Oh no!

    So, the same issue as your first screenshot in the original post?

    Not quite - now the player character is staying within the bounding box of the nav mesh, rather than wandering, only it is transposed upwards.

    It is occuring after the 'stripping'. I'm not sure where I should look for the problem...

  • Send me a new package that accurately demonstratest the problem.

  • OK, can do - the only thing I did was to change the character evasion setting on the nav mesh 'GameStart(stool)' but I can send you that, sure.

  • It is because your MaxsRoomHole1 and MaxsRoomStairHole objects have colliders without "Is Trigger" checked, causing them to push your character out of their boundary.

  • Oh dear.
    Sorry, Chris. That's a total rookie mistake.
    Thanks a lot for helping me out. It is greatly appreciated.

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.