Forum begins after the advertisement:
-
::If you are experiencing a null reference exception on your scene fader, this is probably due to the Scene Fader prefab’s active state being set to false.
To fix this simply set the Scene Fader prefab to active and the Null Reference Exception should be fixed.
::Im having a null exception error on the scene faders, yet my prefab of scene fader is active. The console is pointing me towards this line:
fadeOutUIImage.color = new Color(fadeOutUIImage.color.r, fadeOutUIImage.color.g, fadeOutUIImage.color.b, _alpha);
However, i put a debug line in the update function and its showing that fadeOutUIImage is not null, but when i put one in the SetColorImage function, it returned null. Could it be a script execution issue, or could there be something in the inspector I’m overlooking?
::Hi Paul,
This may be being caused by you having scripts attached to GameObjects that should not have the script. To check this, you can type in t:YourScriptName
into the Hierarchy search textbox at the top of the window and see if there are any GameObjects that should not have the script which has it.
Let me know if this works.
::Turned out to be moving fadeOutUIImage = GetComponent<Image>();
from the Start function to the Awake solved the issue. Thanks again!
Advertisement below: