- Home /
"Unknown error occurred while loading '(path to NavMesh.asset)'." when using NavMesh generated by someone else
Hello. After updating to Unity 2019.4 a colleague and I have been having issues with baked NavMeshes. Whenever one of use bakes a NavMesh and pushes the asset, the other gets the error "Unknown error occurred while loading 'Assets/Scenes/main/main-NavMesh.asset'."
We are using NavMeshComponents and baking with the NavMeshSurface component. We have to re-bake the NavMesh individually whenever the other makes a change to either the NavMesh itself or the scene it is in, because if we push our scene the reference to the NavMesh is lost, as it is stored in the NavMeshSurface component.
I have tried the following:
-Get the file sent over e-mail to ensure this is not a GIT or LFS problem. The files were identical so it was not.
-Compare the NavMesh binary asset files he generates versus mine. I found a lot of differences between the two, even though they were generated on the exact same scenes. The file I generate is 4 bytes larger than his, even though this seems to only be 4 0x00
bytes at the end of the file.
We are both on Unity 2019.4.11f
Has anyone experienced this issue as well?
Answer by MastersOfUs · Oct 22, 2020 at 03:20 PM
I found the solution. It was Git after all. Git interpreted all .asset files as text, and when this file which was binary by chance contained some CRLF bytes, Git stripped the CR bytes before the other person recieved them. It was fixed by changing our .gitattributes rule for *.asset to contain "text=auto" at the end.
Your answer
Follow this Question
Related Questions
Unity has 2 errors on fresh install 0 Answers
Post Processing - NullReferenceException 1 Answer
Assets couldn't be loaded 1 Answer