ContactFilter2D.NoFilter() functionality changed AFTER being deprecated in 6.2

I don’t know if this is a bug, or just feedback for Unity for their future development and/or a request to ask Unity to update their changelogs at the very least. If nothing else I hope this saves others some trouble after upgrading an older project to 6.2+.

I’m frustrated about a seemingly undocumented change to a foundational method after it was deprecated, which definitely seems like bad form.

In 6000.2.0f1 the following deprecation was called out:

Deprecated: Deprecated the ContactFilter2D.NoFilter method. Use the static property ContactFilter2D.noFilter instead.

Okay that’s fine. Except for when Unity devs deprecated the ContactFilter2D.NoFilter() method they also changed its implementation. Previously it modified the instance of ContactFilter2D to filter nothing. Now it is just an alias for the new static property, a pure method that does nothing to the instance you called it on.

This is hugely breaking change for anyone that uses the old method and upgrades to 6.2+. I hope this was a mistake and not something that is considered an acceptable practice between Unity versions? If nothing else please document this sort of thing more clearly moving forward.

Thanks.

It’s just a simple bug, there’s no need to document it. It’s a simple thing to fix so I’ll look at getting that fixed ASAP.

There’s also no need to start considering things like “acceptable practices” to accept bugs or changes to behaviour without notice.

Note that this will be made obsolete soon anyway so consider using the new static method ASAP.

Alright understood, apologies if it seemed a tad dramatic, I think I assumed this wouldn’t be treated as a bug since it was in a deprecated functionality.

I appreciate the very quick response and resolution.

I did move to the new method (since it was top of mind while looking for what caused the upgrade to break various things) and then suddenly everything was fixed. So then I went and made this post. :sweat_smile:

Not a problem, just creating a bug report for it now and as soon as it’s live I’ll give you the issue tracker link.

Thanks for the report.

You can find the issue tracker here. (this may take 30 mins to become live).

I’ve already fixed the issue and will add it to an existing set of PRs being ported from 6.6 to 6.3.

Note: 6000.2 is an unsupported Unity version so we cannot land changes in it anymore so there’s no way I can land a fix there, sorry.

Thanks for the report!

Amazing, that’s gotta be a record turn around time, thank you again.

And no worries, I’m on latest 6.3 LTS, I marked it 6.2 since that’s when I assumed the bug was introduced.

I like to keep 2D physics at zero bugs. :wink:

Just a heads-up to say that this fix is in review and will hopefully be landing soon.

Great news, thanks for the update