UniStorm Weather System Wiki
All Contributors
A FANDOM User

"Please apply a C# Sun Shaft Script to your camera GameObject" -- I have TWO

I already had a first-person "player" in my game, and so I manually added the scripts I saw under the C# pre-fab's Camera to my existing camera.  This means that my Camera has two instances of the C# "Sun Shafts" script on it, with the UniStorm Sun_Moon and MoonLight dragged in to each as the "shafts caster".  

I also told UniStormWeatherSystem_C my Camera's GameObject by dragging it into the slot.

However, the error message appears indicating that the UniStorm script doesn't see this component.

0 3
  • Upvote
  • Reply
0
A FANDOM User

Ok, I think I found the issue.

There is a UnityStandardAssets.ImageEffects.SunShafts.cs and ALSO a UnitySampleAssets.ImageEffects.SunShafts.cs

I have the wrong one on my camera.

0
A FANDOM User
76.24.20.37 wrote:
Ok, I think I found the issue.

There is a UnityStandardAssets.ImageEffects.SunShafts.cs and ALSO a UnitySampleAssets.ImageEffects.SunShafts.cs

I have the wrong one on my camera.

Hell.. Still not working, and I see your own Desktop demo (C#) is showing the same error.

0

Solution:

I have to fully qualify this script's package to get it properly identified -- two line edit to your Editor script


    public UnityStandardAssets.ImageEffects.SunShafts sunShaftScript;

and


        sunShaftScript = cameraObjectComponent.GetComponent<UnityStandardAssets.ImageEffects.SunShafts>();

Write a reply...