ScreenSpaceAmbientObscurance is inaccesible due to it's protection level

I’m trying to get the component ScreenSpaceAmbientObscurance from my camera so I can disable/enable it based on settings.
But for some reason it can’t be found in my class, all the other image effect have no issues.

With this code visual studio doesn’t have any errors:

using UnityStandardAssets.ImageEffects;
...
camera.GetComponent<ScreenSpaceAmbientObscurance>()

But Unity says: The type or namespace name `ScreenSpaceAmbientObscurance’ could not be found. Are you missing a using directive or an assembly reference?

And with this code:

using UnityStandardAssets.ImageEffects;
using ScreenSpaceAmbientObscurance = UnityStandardAssets.ImageEffects.ScreenSpaceAmbientObscurance;
...
camera.GetComponent<ScreenSpaceAmbientObscurance>()

Visual studio says:
‘UnityEngine.Component.GetComponent<UnityStandardAssets.ImageEffects.ScreenSpaceAmbientObscurance>()’ is inaccessible due to its protection level.
And Unity gives the same error.

Any ideas how to solve this?
All other image effects work as expected.

Is ScreenSpaceAmbienceObscurance a public class? If not, try making it public.

1 Like

Thanks, that fixed it!
Wonder why it isn’t public by default…

1 Like