Error with PixelPerfectCamera After Upgrading to Unity 6 in URP 2D Project

After seeing the official release of Unity 6, I immediately installed version 6000.0.23.f1.

I am encountering an issue after upgrading a project from Unity 2022.3.47f1 to Unity 6, specifically related to the PixelPerfectCamera in URP 2D projects. Here’s a detailed explanation of the problems:

  1. Upgrading an Existing Project:
    After upgrading my project from Unity 2022.3.47f1 to Unity 6, I get the following error:
    Library\PackageCache\com.unity.2d.pixel-perfect\Editor\Converter\U2DToURPPixelPerfectConverter.cs(26,65): error CS0234: The type or namespace name ‘PixelPerfectCamera’ does not exist in the namespace ‘UnityEngine.Experimental.Rendering.Universal’ (are you missing an assembly reference?)

  2. It seems like the PixelPerfectCamera component is no longer available in the UnityEngine.Experimental.Rendering.Universal namespace.

  3. Creating a New URP 2D Project in Unity 6:
    To investigate further, I created a fresh URP 2D project in Unity 6. Surprisingly, I encountered the same error as soon as the project was set up.
    If I remove the URP package via the Package Manager, the error goes away, but as soon as I reinstall URP, the error reappears—even though this is a completely new project with no additional content.

It seems there’s an issue with the PixelPerfectCamera in Unity 6’s URP 2D setup, but I haven’t been able to find a clear solution online. Is there a known fix or workaround for this issue? Any insights or suggestions would be greatly appreciated!

"Hi everyone,

I just wanted to check in and see if anyone has come across a similar issue or might have any advice. I’m still experiencing the problem with the PixelPerfectCamera in the Unity 6 URP 2D setup. Any help or suggestions on how to resolve this would be greatly appreciated!

Thank you!"

Yes, I have the exact same issue. It’s hard to imagine that this is actually the latest editor version. I guess we can only wait for a solution.

It’s a bit strange that after installing the latest version of Unity 6 on my very old MacBook, I don’t seem to encounter this issue, but on my Windows 10 computer, the problem persists.

This error happens because the version of the 2D Pixel Perfect package included by default is not compatible with Unity 6 + URP 17.x.


Solution Steps

  1. Open Package Manager
    Go to Window > Package Manager in the Unity Editor.

  2. Switch to Unity Registry
    In the top-left filter dropdown, change from In Project to Unity Registry.

  3. Find 2D Pixel Perfect package.

  4. If the package is locked:

    • Click the three-dot menu (⋮) in the top-right.
    • Choose Unlock to enable updates.
  5. Update the 2D Pixel Perfect package to version 5.1.x.

  6. Restart Unity. The error should be gone, and the project should now run properly.


Notes

  • Unity 6 uses URP version 17.0.x.
  • The default 2D Pixel Perfect version (5.0.3) is not compatible with URP 17.
  • Version 5.1.x of the 2D Pixel Perfect package resolves the compatibility issue.
  • You don’t need to manually edit manifest.json; everything can be done through the Unity UI.

Optional

If issues persist after the update, try deleting the Library folder in the project directory and restarting Unity to clear any cached data.

  • This content was translated with the help of ChatGPT.