Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Pixel Perfect Camera bug?

Discussion in '2D' started by Volshar, Dec 11, 2022.

  1. Volshar

    Volshar

    Joined:
    Mar 14, 2021
    Posts:
    15
    Hi,

    after upgrading from 2021 LTS to 2022.2 Tech preview I'm getting this error:

    Code (CSharp):
    1. MissingComponentException: There is no 'Camera' attached to the "Main Camera" game object, but a script is trying to access it.
    2. You probably need to add a Camera to the game object "Main Camera". Or your script needs to check if the component is attached before using it.
    3. UnityEngine.Experimental.Rendering.Universal.PixelPerfectCamera.get_cameraRTSize () (at D:/project/Library/PackageCache/com.unity.render-pipelines.universal@14.0.4/Runtime/2D/PixelPerfectCamera.cs:343)
    4. UnityEngine.Experimental.Rendering.Universal.PixelPerfectCamera.UpdateCameraProperties () (at D:/project/Library/PackageCache/com.unity.render-pipelines.universal@14.0.4/Runtime/2D/PixelPerfectCamera.cs:372)
    5. UnityEngine.Experimental.Rendering.Universal.PixelPerfectCamera.Awake () (at D:/project/Library/PackageCache/com.unity.render-pipelines.universal@14.0.4/Runtime/2D/PixelPerfectCamera.cs:367)
    6. UnityEditor.InspectorWindow:RedrawFromNative()
    I'm not getting this error in 2021 LTS and there is Camera attached to the gameobject where Pixel Perfect Camera component is attached too. When I remove the Pixel Perfect Camera component the error stops. Can I do something about it or is it a bug?

    However, Im only getting this error while I'm editing prefab, Im not getting this error during gameplay. Can I ignore this?
     
  2. TomasPetrlik

    TomasPetrlik

    Joined:
    Dec 29, 2018
    Posts:
    12
    Did you tried adding Camera component ?
     
  3. Volshar

    Volshar

    Joined:
    Mar 14, 2021
    Posts:
    15
    Yes, the camera component is already present on the gameobject.