はこねのはこ

はこねさんの備忘録

The type or namespace name `PostProcessing' does not exist in the namespaceが出た時の話

初めに

新PCを購入し、Unityプロジェクトを移行していたとき、このエラーが出て困ったので備忘録としてメモします。

The type or namespace name `PostProcessing' does not exist in the namespace 'UnityEngine.Rendering' (are you missing an assembly reference?)

f:id:hakonebox:20220116203514p:plain

解決法

PostProcessing v 2.3.0を使用する f:id:hakonebox:20220116203716p:plain

私の場合は移行前の環境ではPostProcessing v2を使用していて、
移行先の新PC環境ではPostProcessing v3を使用しようとしていただからと思われます。

背景

  • Unity 2020.3.16f1

Package ManagerからPost Processing v 3.1.1を使用していたのですが、上記のエラーが出て困っていました。

原因を探していると、CinemachinePostProcessing.csの中に下記の記述がありました。

// NOTE: If you are getting errors of the sort that say something like:
//     "The type or namespace name `PostProcessing' does not exist in the namespace"
// it is because the PostProcessing v2 module has been removed from your project.
//
// To make the errors go away, you can either:
//   1 - Download PostProcessing V2 and install it into your project
// or
//   2 - Go into PlayerSettings/OtherSettings and remove the Scripting Define for UNITY_POST_PROCESSING_STACK_V2

私の環境では1のv2のインストールで無事解決しました。

移行前の環境のバージョンを確認せず、PostProcessingの最新を入れていたので
表題のエラーが出て焦りました。