I cannot get script component.

I want to enable/disable bloom effect through script. I have done it in my previous projects successfully. I’ve tried creating new projects, scripts. Nothing helped.

Bloom’s no longer a class as of Unity 5.4 or so. Use the Post-Processing Stack. Search for it on asset store.

Where in your project is the ‘Bloom’ script located? You probably need to add a reference to it at the top of your file.

You are trying to get the script from a transform type object. Try this instead

target.gameObject.GetComponent<Bloom>();

This is assuming. The target variable is assigned with the MainCamera’s transform.