Forum rules - please read before posting.

Pathfinding error related to the persistence of navmesh holes

edited February 2021 in Technical Q&A

I found an issue regarding the persistence of navmesh holes.

I have a scene where the camera moves vertically between different floors (each floor having its own navmesh and sortingmap). It all works except for when I load a saved game where the player has entered another floor, in which case I get "Pathfinding error - cannot build spanning tree from (3.4, 7.1) to (5.2, 8.4)".

The warning appears exactly when crossing a navmesh region, so I narrowed the problem down to the navmesh holes. Each navmesh has its own hole and if I remove those holes evertything loads fine. All navmeshes has the RememberNavMesh component and all navmeshes and holes has a constant id component.

AC: 1.73.1
Unity: 2020.5.5f1

Comments

  • edited February 2021

    Thanks for the report, but I'm afraid I'll need more complete steps to reliably reproduce the issue. Are you switching the scene's NavMesh with the "Scene: Change setting" Action? Baking your NavMeshes?

    Please also share the exact error message in full - stacktrace included.

    A repro package that demos the issue would be best, if you can share one.

  • Yes, the scene's navmesh is switched using the "Scene: Change setting" Action. The holes in the navmeshes are not baked into the navemesh.

    Here's the stack trace:

    Pathfinding error - cannot build spanning tree from (12.7, 6.4) to (7.6, 7.8)
    UnityEngine.Debug:LogWarning (object,UnityEngine.Object)
    Scuac.Logger:WriteToLog (Scuac.LogLevel,string,UnityEngine.Object,bool) (at Assets/Scuac/Runtime/Logger.cs:69)
    Scuac.Logger:Warning (string,UnityEngine.Object) (at Assets/Scuac/Runtime/Logger.cs:103)
    Scuac.Components.RuntimePersistentLogicBootstrapper/<>c:b__1_0 (object,AC.DebugLogType,UnityEngine.Object,bool) (at Assets/Scuac/Runtime/Components/RuntimePersistentLogicBootstrapper.cs:28)
    AC.EventManager:Call_OnDebugLog (object,AC.DebugLogType,UnityEngine.Object,bool) (at Assets/AdventureCreator/Scripts/Managers/EventManager.cs:1841)
    AC.ACDebug:LogWarning (object,UnityEngine.Object) (at Assets/AdventureCreator/Scripts/Static/ACDebug.cs:29)
    AC.NavigationEngine_PolygonCollider:GetPointsArray (UnityEngine.Vector3,UnityEngine.Vector3,AC.Char) (at Assets/AdventureCreator/Scripts/Navigation/NavigationEngine_PolygonCollider.cs:166)
    AC.PlayerMovement:ProcessHit (UnityEngine.Vector3,UnityEngine.GameObject,bool) (at Assets/AdventureCreator/Scripts/Controls/PlayerMovement.cs:1086)
    AC.PlayerMovement:SearchForNavMesh2D (UnityEngine.Vector2,UnityEngine.Vector2,bool) (at Assets/AdventureCreator/Scripts/Controls/PlayerMovement.cs:1142)
    AC.PlayerMovement:PointControlPlayer () (at Assets/AdventureCreator/Scripts/Controls/PlayerMovement.cs:910)
    AC.PlayerMovement:UpdatePlayerMovement () (at Assets/AdventureCreator/Scripts/Controls/PlayerMovement.cs:119)
    AC.StateHandler:Update () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:242)

  • At what time do you use the Action, and how does it relate to "crossing the region"? Do NavMeshes overlap?

    Any form of screenshot or additional material will help understand the situation better.

  • The action is used when changing floor where I:
    1. teleport the player to the new y pos
    2. swap the navmesh
    3. change the players sortingmap

    No navmeshes or sortingmaps are overlapping.

    By "crossing the region" I just ment that everything works fine until loading a saved game where the player has moved floor, and then clicking to move the player up and down that floor. I then then get the warning when the player is in the vertical position of the nav mesh hole of the new navmesh.

  • I cannot recreate such an issue. I really will need a means of having a sample scene to test with.

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.