Unity Line Ending Mismatch Issues

So heres an issue that I’ve had with Unity for a long time. Ever create a new script, add some variables and functions to it and hit save, then all of a sudden Unity and Visual Studio are complaining about the line ending being a mix of linux and windows style? Well apparently its still an issue, but there is an easy fix for it now.

Back in the day, the only fix was to navigate into some weird folders hidden inside your Unity installation, and then manually edit all the template files for different types of scripts you will use and convert the line endings in them to your desired format.

However, there’s seems to be a quicker fix nowadays, and its built into Unity itself. Now why is this issue not fixed automatically? Who knows. Probably because most of the Unity devs most likely use Macs and so aren’t directly affected by this. But for the rest of us poor folk who either can’t afford a Mac or choose not to use one for moral reasons, it can be a bit of a pain.

But anyways here is the solution:

  1. In Unity goto Edit -> Project Settings-> EditorScreenshot 2018-05-23 09.45.56
  2. At the bottom of the list change the Line Endings for New Scripts Mode from Linux to Windows. You could also try OS Native.
    Screenshot 2018-05-23 09.46.05

And voila, you might not get line ending errors anymore, at least for new files.

This is where I found the solution.

Well good luck and thanks for coming.

 

Advertisement

About mkoetse

Computer Nerd Extraordinaire
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s