Forum rules - please read before posting.

Navmesh causing lag?

I'm working on my first project, and i'm having an issue with navmesh. Whenever the player approaches a navmesh hole, game lags, like it's taking too long to calculate path. Could it be that my navmesh is simply too big?


Sorry, i think i posted on the wrong section

Comments

  • edited August 2022

    Welcome to the community, @Rhapsodynipas.

    It may not be down to the size of the NavMesh, but rather its complexity. There are workarounds, such as swapping to different NavMeshes as you navigate the scene, but let's get some more details about the situation first.

    How many vertices does the NavMesh have, including those of any holes you've defined for it? Share screenshots of how it's shaped, and reduce the number of vertices if it's possible without affecting its overall shape.

    You're welcome to PM me your scene file (graphics should be unnecessary) for me to examine directly.

    Also, how does your Player character's scale compare with that of the 2D Demo's Player prefab, Brain2D?

    The NavigationMesh component includes a few options to aid performance. What are they currently set to, and what is the effect of lowering the Accuracy slider?

  • Thanks for the reply. The navmesh is pretty simple, so it's probably the size that's causing the problems.

    About the size, it's a little bigger than Brain. Wold it be necessary to reduce the pixels per unity of my assets?

    Reducing accuracy helped a lot in reducing the response time, but i'm interested in your idea of using multiple navmeshes, but i don't really know how to travel from one navmesh to another. Player can only move on the main navmesh.

  • Wold it be necessary to reduce the pixels per unity of my assets?

    No, I'd say you're fine - it's more a measure of how much you'd tweak sliders from their default values. They're comparable enough to not need resizing.

    Reducing accuracy helped a lot in reducing the response time, but i'm interested in your idea of using multiple navmeshes, but i don't really know how to travel from one navmesh to another.

    If you have multiple NavMeshes, you can switch between them by using the Scene: Change setting Action's Change NavMesh method. This'd typically placed in a Trigger that causes the NavMesh to swap out when entering a particular region.

    Could you PM me the scene file so that I can see the lag on my end?

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.