Schrödinger's warning with MonoBehavior camera member (whether new keyword is used or not)
In my MonoBehavior, defining this memberCamera camera;
gives the warningAssets/Scripts/CreditsManager.cs(43,16): warning CS0108: 'CreditsManager.camera' hides inherited member 'UnityEngine.Component.camera'. Use the new keyword if hiding was intended
butnew Camera camera;
gives the warningAssets/Scripts/CreditsManager.cs(43,20): warning CS0109: The member 'CreditsManager.camera' does not hide an inherited member. The new keyword is not required
Which one is it? What am I supposed to believe? Either way, I can't get rid of a warning.
Answer by UnityCoach · Oct 03, 2018 at 12:28 PM
This happens with all the deprecated component members, like rigidbody and such. Anyway, if it's private, it could/should be _camera, or m_camera. I'd use the new keyword if in doubt.
Your answer