Pathfinding Works in Editor Playmode but not in game Build?

Hi, I have this very strange behaviour that I have no idea how to address.

If I run my game and follow the workflow from the beginning (no shortcuts), I reach a scene where I can click on the environment to send a create move there. the click creates a “move to object” object with some visuals in the UI.

Here’s the problem… If I perform this workflow in Unity’s editor PlayMode, all works as expected. However, If I make a build and then perform the exact same workflow on the build, the “move to” object is spawned but the character doesn’t move (for some reason may find a path?)

Does anyone know what could be the problem and how I can “debug” this since the problem only happens in the Build?

Have attached an image for reference.

  • In Play Mode, the creature will move between the Red and Yellow areas with no problem
  • In the Game Build, the creature will only move in the Red area and trying to send it to the Yellow area doesn’t work

Many thanks in advance.

Hi

Have you checked the log to see if there are any relevant messages?

noob questions (I know …) but how do I do that for a Build game? :S

thanks

It could be related to -2 != -2 error. I have the same when using navmeshcut script, it does work in editor after this error, but crashes on linux dedicated server. 5.1.6 ver.

@Donatas_Kanapickas
not sure I’m aware of that error. are you able to tell me where I can happen so I can try to check if it’s happening in the editor too ?

It happens when I use navmeshcut with cutting once at start. Happens in both editor and build(build crashes though, while editor doesn’t, just throws the -2!=-2 error). It also doesn’t happen on all navmesh resolutions, but on most of them (looks like all smaller tile resolutions fail). I have my world split into many recast graphs for faster calculations with some 75 meter offset into each other. And it appears to not mater where I place the navmeshcut, though maybe.

image

Example failing graph if I place navmeshcut on it (doesn’t mater which one sphere, circle etc, all of them fail)(5.1.6 ver):