[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!
It looks like you're new here. If you want to get involved, click one of these buttons!
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:
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!