Pathing error on build

Hi. I’ve been using the pro version of the plugin for a few weeks now and it’s been working perfectly when testing on editor. I’ve recently made a build but now I’m finding many inconsistencies in the pathing that never happen on editor.

At first I thought it could be a problem with the cached files for my first scene, so I updated them and tried again. This did not solve it, so I disabled the cached graph and tried with the graph generated at awake, but it did not help either. Since my code instantiates items right after loading a scene I thought that this could be the issue too, but I’m now generating the graph only by code after all logic related to the scene and once again it did not solve the problem.

I have two characters: one is the main character and the other is the follower. If I walk towards north the follower should move behind me, but it moves to the left instead! I checked my code since I’m moving the character by using its steering target (I’m not using any type of agent, I’m moving the characters with kinematic character controller plugin and Opsive’s behavior designer), and the direction that the character is being told to use is towards west instead of north.

This only happens on build, because on editor my character moves correctly behind me all the time, even with the graph being generated by code. Any help would be very much appreciated.

  • A* version: [5.1.6]
  • Unity version: [2023.2.13f1]

I want to add more info into this issue: I’ve found that this only happens on my first level, but not on the rest of the game.

I have multiple different scenes, they all work fine EXCEPT one (which, coincidentally, is the first one). It’s not the first scene to be loaded (that would be the main menu) and I’ve tried going from the main menu into a different scene and they all work fine, so it’s not an issue on initialization. It seems to be a problem for that particular level.

I’ve removed/added all prefabs that could be missing/added in the level to check if it could be a problem with, for instance, a dynamicobstacle or a navmeshcut, but I can still only reproduce this error on the first level.

I can now give some very good news. I’ve found the issue: the graph was being badly calculated on build because of meshes in the scene not being readable.

After I made all meshes readable so that the warning message from the Astar gameobject was gone, I could build and play without issues!

Leaving this in case this helps some other people, took me a bit of work to figure out haha

2 Likes

That’s one of those bugs that would drive me straight crazy. Thanks a ton for submitting that info, super appreciated!