Forum rules - please read before posting.

Player clipping through corners of the NavMesh: increasing Pathfinding update time.

edited September 2020 in Technical Q&A

[Unity 2019.4.9f1 - Adventure Creator v1.71.8]

Hello!

I'm working with (2D) scenes that have very strict corners in their NavMesh and I noticed this happening.


(the GIF has been slowed down on purpose)

Imagine two floors connected by a ramp of stairs. I'm trying to have the smallest possible walkable area for the top floor, as the background will basically be flat 2D, so to make the character unable to walk on the Y axis.

Still, this doesn't seem to be really an issue related to the size of the NavMesh, because even if I make it larger and\or if I disable the Circle Collider on the Player this still happens.

It seems to be working better (or even actually working) if I set the Pathfinding update time to 0.01f but I'm not sure about the potential performance issues that this could cause in the long run, if any.

If anything, I imagine I could change that value just when the game requires it and leaving it to 0 otherwise, but, again, I'm not sure it's the best idea.

Is this a correct way to deal with the issue?

As always, thanks a lot in advance!

Comments

  • The issue isn't due to update times - it's due to accuracy.

    See the Manual's "Precision movement" chapter for full details on this, but the two things you'll want to try are:

    1. Raise the Destination accuracy slider in the Settings Manager, (and optionally play with the Attempt to be super-accurate? option)
    2. Enable Retro-style movement? in the character's Inspector.

    On the topic of "very thing" NavMeshes, it's possible to limit a character's movement to one axis through scripting - see this page on the wiki.

  • Thank you for the reply, Chris!

    Tweaking those values seems to work in my favor! I'll try to use that as a basis to come up with a solution that best suits my needs.

    The same goes for the link you shared, thank you: I completely missed that in the wiki and will likely repurpose it as well.

    Thanks a lot!

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.