Inconsistent Line Endings

In the print(“Welcome to Number Wizzard”);
after i made it, this appeared in console:

There are inconsistent line endings in the ‘Assets/scripts/NumbWizz.cs’ script. Some are Mac OS X (UNIX) and some are Windows.
This might lead to incorrect line numbers in stacktraces and compiler errors. Many text editors can fix this using Convert Line Endings menu commands.


Hi @CaioZumerle,

The issue is because the templates that are used in the background for the script file generation are saved (and then installed on to your PC) with the Mac OS X (UNIX) line endings, e.g. an “LF”

After you create your script, open it and edit it - in presumably MonoDevelop - the lines that you add or amend then have a different format for the line endings, e.g. a “CRLF” sigh

I typically use Visual Studio and I just go to File - Save As… and then there is a small drop down menu which enables me to change the format to all be Windows based. I have to perform this each time obviously otherwise I get the same message as you have mentioned. This is what I would call the lazy way, although ironically it creates much more work long term if you write a lot of scripts.

The alternative would be to browse to your installation directory of Unity and replace the template file, by doing so you won’t be bothered by these warnings, or, do what I do each time :slight_smile:

Note: Your installation path may vary from mine, the important part is /Editor/Data/Resources/ScriptTemplates, this may vary from Unity versions.

If you don’t have it already, you can grab a copy of Notepad++ for free from here, it has a built in feature to change the line endings of a given file;

If you have Visual Studio installed, you could simply open up the template file in that, and then save it via the method I describe at the top of this post.

The end result you want to have is this;

Hope this helps :slight_smile:

(I’m off to finally change mine now!)


thanks, but when i closed and opened it again, the box to change for windows appeared, so i just changed, but thanks for the resolution, i may use it in future.

1 Like

You’re welcome.

Privacy & Terms