C#- Activate Image effect Help

Hello, i have a small problem:

I want that if my health points are under 25- the image effect calles CameraMationBlur on the main camera is enabled. the script must be attached to my player, so i wrote:
public GameObject cam;

if (hitPoints <= 25.0f){
cam = GameObject.FindGameObjectWithTag (“MainCamera”);
CameraMotionBlur.enabled = true;

it doesnt work. i always get this error :frowning:

KerboEngine/Scripts/Player/PlayerCore.cs(1075,42): error CS0120: An object reference is required to access non-static member `UnityEngine.Behaviour.enabled’

KerboEngine//Scripts/Player/PlayerCorer.cs(1073,25): error CS0029: Cannot implicitly convert type UnityEngine.GameObject[]' to UnityEngine.Camera’

:frowning: Thanks for help :slight_smile:

You probably wanted to write this:

cam.GetComponent<CameraMotionBlur>().enabled = true;

BTW: If the camera is tagged “MainCamera”, you can access it directly using “Camera.main”, you don’t need the FindGameObjectWithTag().