1
\$\begingroup\$

I'm using Unity 5 and I'm getting an error in a YAML file. The error is "Unable to parse YAML file: [mapping values are not allowed in this context] at line 1" This comes up every time I open the engine.

I've seen some say to open the YAML file and change some stuff in it. But I can't even find the YAML files. I've also seen that it's caused by meta file issues and version control. The project is local but I don't know if it matters if it's local or cloud based.

Does anyone have a solution for this issue?

\$\endgroup\$
1
\$\begingroup\$

It seems your scene(s) has/have corrupted, the system can't read some particular scene(s). Try to check every scene to find out which one has corrupted, if you do have a backup then restore the scene files.

Unity Manual: Textual Scene File Format - Format Description

\$\endgroup\$
  • 1
    \$\begingroup\$ I've gotten this before from files in Project Settings too, if asset serialization mode is set to "force text" - so it might not just be scenes. \$\endgroup\$ – DMGregory Jun 27 '15 at 0:40
  • \$\begingroup\$ You may try to find YAML formatted files with the documentation, currently I found "scenes" are using this format. No clue for your question sorry. \$\endgroup\$ – Fatty Mieo Jun 27 '15 at 0:50
  • \$\begingroup\$ Thank you for the reply. It's been very difficult getting a reply to this question. Something odd happened that fixed itself: I was able to open all the scenes. I deleted all the scenes I'm not using anymore. I closed Unity and reopened it each time I deleted a scene. Still had the error. I made a back up of the entire project folder so I could delete the scene I'm working in. When I went into the back up folder to delete it, the error was gone. I went back to the original project and the error was gone. \$\endgroup\$ – coderage9001 Jun 29 '15 at 15:10
  • \$\begingroup\$ Continued: The only difference was there was an asset crash report and a temp file that wouldn't copy to the back up. It said it could no longer find that .txt file and the Temp folder I'm assuming it was in? Either way, it's gone and I really don't know why. But thank you. If you hadn't told me to check scenes, leading me to delete the scenes, I wouldn't have made that back up until who knows when. Thank you. \$\endgroup\$ – coderage9001 Jun 29 '15 at 15:17
  • \$\begingroup\$ I'm wondering though. Do you think that asset crash report was the issue? It was a temp file so it's gone now. I think I'll dig it out of the memory and give it to the Unity team. Thanks again. It was driving me nuts. haha \$\endgroup\$ – coderage9001 Jun 29 '15 at 15:19
0
\$\begingroup\$

I had the problem of "Broken YAML file" when I tried to open one of my old projects. With the above error, all the game objects in the scene turned to "Missing Prefab".

The project was created using Unity 5.21. I tried to open the project with Unity 5.40 and it worked. Now there were no "Broken YAML file" error nor "Missing Prefab" and it worked fine for me.

\$\endgroup\$
-1
\$\begingroup\$

Close Unity and open explorer. Now search all the .meta files from your project. Delete them all and open Unity again. It will create new meta files. And issue would be resolved.

\$\endgroup\$
  • 1
    \$\begingroup\$ That will break all the references between prefabs, etc, don't do that! meta files are important, they are a way to identify an asset inside unity. \$\endgroup\$ – arielsan Oct 2 '17 at 14:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.