[Solved] Unity3D: error CS1644: Feature `out variable declaration’ cannot be used because it is not part of the C# 4.0 language specification

As a Unity3D noob I come across little errors and hurdles all the time. Yeah, the learning curve can be steep but learning is what it’s all about. Our latest roadblock came in the form of the error below. This happened while importing an older project into a newer version of Unity3D via the Unity Hub. The error itself is vague but once you decode it, it’s not that scary and the solution is very simple.

error CS1644: Feature `out variable declaration’ cannot be used because it is not part of the C# 4.0 language specification

The error is due to an incorrect/deprecated scripting runtime version of .NET in the Project Settings and while your error may refer to a different ‘Feature’, the gist is the same.

The Solution:

From the menu, go to Edit -> Project Settings -> Player -> Other

Once you’re there, change the following:

a) Scripting Runtime Version from 3.5 to .NET 4.x Equivalent
b) Api Compatibility Level from .NET Standard 2.0 to .NET 4.x

You’ll then need to restart Unity and your project should run. Enjoy!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.