Standard Assets GetComponent()

Hi:
I have tried everything that I found and still can not get the getcomponent to work with a script reff. This is a sample of what I am trying to do, not just for BlurOptimized but i will like to access other standard asset components aswell.

using UnityStandardAssets.ImageEffects; //ImageEffect does not exist in namespace

public class PlayMode : MonoBehaviour
{
    public BlurOptimized camBlur; //"BlurOptimized" could not be found
    public GameObject camObj;

    void Awake()
    {
        camBlur = camObj.GetComponent<BlurOptimized>(); //"BlurOptimized" could not be found
    }

    void SomeMethod()
    {
        camBlur.blurSize = 0; //can not get this to work
    }
}

Thanks: James

I believe Unity messed up with the Effects folder, so the namespace of ImageEffects doesn’t reflect the folders structure now :wink:

When you import ImageEffects Assets you get Folders structure like:
Standard Assets > Effects > ImageEffects

But the namespaces are like this:
UnityStandardAssets.ImageEffects (there is no Effects part in it)

When you move ImageEffects folder out of the Effects folder and put it directly to Standard Assets then problem dissappear :slight_smile:

Conclusion: change your folders structure to be like this:
Standard Assets > ImageEffects