Pathfinding behaves differently when I build the game compared to the editor

Hello all,

I have got the Pathfinding working great in my game (in the editor), but when I Build and Run I get some very odd behavior.

I am using Recast Graph, AIPath, RVO Controller and Raycast modifier and, like I said, everything working as expected when played in the editor. When I build a standalone version of the game the pathfinding still works (in that the characters move toward the destination) but they ignore any obstacles and just ‘climb’ over them! Very strange.

I did try to do some searches before raising the question on this forum and there seems to be a few general issues mentioned but nothing that I can pin down in my case.

I’d be most grateful if anyone could let me know if they have experienced the same issue and how to resolve it.

Thanks in advance

Ian

Hi

The most common issue is that you have some meshes which are statically batched by Unity. You should be getting an error message in the game log if that were the case. Do you think you could check for that?

The message in question is listed at the bottom of this page: https://arongranberg.com/astar/docs/errormessages.html#static-batching

Morning Aron,

Once again thanks for the swift reply.

Yes, there are a lot of errors in the log and it looks to be exactly the problem you describe. I am not at my PC at the moment so will try a resolution tonight.

Sorry i didn’t pick this up in your documentation. I just didn’t make the connection in my head that the symptoms I was seeing were as you describe in the link (If I’d seen the error messages in the log I’m sure i would have figured it out)

many thanks again

Ian

1 Like

Hi,

Yes, setting all objects in the area of the Mesh to Non-Static solved the problem. Thanks.

I did set them to static to improve Unity performance. I don’t think it will make much difference if they are not. I’ll investigate the other options you proposed later if needs be.

cheers

Ian

1 Like