0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Pixel Perfect Camera が参照できない

Last updated at Posted at 2025-07-31

GetComponent()

タイトルのように入力したのにnullが返ってくる人へ
using UnityEngine.U2Dから
using UnityEngine.Experimental.Rendering.Universal;
に変更したら参照できるようなりました

github copilotが出したコードはずっと間違えていた。
https://discussions.unity.com/t/unable-to-grab-a-reference-to-a-pixel-perfect-camera-component/916507

追記
Unity6.x以降から、参照エラーが発生しました。
https://discussions.unity.com/t/error-with-pixelperfectcamera-after-upgrading-to-unity-6-in-urp-2d-project/1538791/6
Package Managerから2D Pixel Perfectをインストールすることで解決できます。

Namespace: UnityEngine.Rendering.Universal
Assembly: Unity.RenderPipelines.Universal.2D.Runtime.dll

スクリプトが asmdef 配下ならDLLファイルを、追加してください

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?