Search Feedback


Remove obsolete/deprecated methods/components




Please remove most of/all obsolete code. There's now extreme amounts of code left overs since the early days cluttering down intellisense for no reason. Some major pains are the public static methods in Quaternion, GameObject and the default components in all Objects.

I'm a teacher trying to teach people to use Unity, and telling people they have to make a new variable and reference it to the assigned Rigidbody instead of just using ".rigidbody" is a major confusing for a lot of people. Not to mention that you'll have to hide the member using "new" if you want to use that particular name.

I feel like this is long overdue now. With the introduction of a new Versioning system (since 201x.x) it's a perfect opportunity to break some backwards compatibility for once. If people still want to work on their legacy code they'll just have to upgrade or suck it up. The clutter is starting to get real.

Comments (5)

  1. Fa823619738c01374722c58935fbc2cd?d=mm


    Oct 27, 2018 18:29

    You can't just remove legacy code, it would break apps using them.

    Instead, legacy code should log warning in the console and be highlighted as DEPRECATED in the documentation.

  2. 2327d479768451143ec989f11327b3a4?d=mm


    Jul 26, 2018 06:28

    For the love of all, even if you are not going to remove them, give us an option to switch to a version of unity's codebase that simply Does not contain the deprecated methods.
    So that if you are writing code you don't get bothered by RANDOMRANGE when you want RANGE inside Random, and all those other useless old methods that could have even been UnityUpgradeable for over a year or more.

    Deprecation == get rid of it next big unity version. It is not that hard. The comments on what to use instead is 99% clear enough to resolve a deprecation anyway.

  3. 90ae2ed3429ef8ab4087fb7105407bd6?d=mm


    Jul 09, 2018 01:11

    I think the main reasons why they still keep outdated / deprecated / not functioning methods, properties and classes is to show a proper warning in the editor. If a project contains deprecated elements and Unity would remove them, the code will no longer compile. However the warnings depend on a successful compilation in order to access the attributes and to get the warnings. A better suggestion would be to mark completely obsolete things with the "EditorBrowsable(false)" attribute which will make Visual Studio to not show / suggest it anymore. So it would still be there and still compile but would not clutter intellisense.

    Unfortunately Microsoft is not willing to provide a way to hide deprecated members in Visual Studio due to lacking support of us:

  4. 323ebc87c1d690288ce762b0415b72f8?d=mm


    Apr 16, 2018 10:13

    some deprecated code doesnt work. so you can call the method but nothing happens. why does it even exist then?

  5. 849ebd1f0cf3b83531dba72de32f3adf?d=mm


    Apr 11, 2018 01:28

    I don't entirely understand your closing comment. "If people still want to work on their legacy code they'll just have to upgrade or suck it up" is a contradiction. Wouldn't it be that if people want to work on their legacy code they will have to stay on a previous version or update the code? They wouldn't upgrade to work on legacy code, since it would be incompatible.

    I am all for removing deprecated code after a reasonable interval, so long as the #if !UNITY_X_OR_NEWER tags continue to completely ignore that code (to prevent it breaking compatibility with newer builds) and there is still some way to access past documentation. Many professional game platforms, such as PSN or Nintendo, require using a specific version of the editor and it is often outdated.

    I do hope your students aren't that confused by things like deprecation. It would be unfortunate to see them unable to work at certain companies simply because of the Unity version they currently require.

Your opinion counts

Help us make things better. Share your great idea for improving Unity or vote for other people’s.

Log in to post a new idea








AI & Navigation






Asset Store


Asset Store Publisher






Cloud Build




Docs & Tutorials






Game Performance Reporting


















Profiling & Optimization