I have a scene in my project which has two entrances, and therefore on the "room enter" cutscene I check for the previous scene. The engine check scene action works fine for this most of the time, and in fact I have no problems when testing it out in the editor.
However, in one of my Windows builds, there is a problem when entering the scene from the "second" room, and I get this message in the log:
NullReferenceException: Object reference not set to an instance of an object
at AC.AssetLoader.RetrieveAsset[AnimationClip] (UnityEngine.AnimationClip originalFile, Int32 _ID) [0x00000] in <filename unknown>:0
at AC.RememberNPC.LoadData (AC.NPCData data) [0x00000] in <filename unknown>:0
at AC.LevelStorage.UnloadNPCData (System.Collections.Generic.List`1 _npcs) [0x00000] in <filename unknown>:0
at AC.LevelStorage.ReturnCurrentLevelData () [0x00000] in <filename unknown>:0
at AC.SceneSettings.Start () [0x00000] in <filename unknown>:0
(Filename: Line: -1)
Now, what is strange about this is that the room enter cutscene has a third scene parameter to check for, which is an intermediate scene of sorts. So for clarity, let's say I have scene 1, 2, 3 and 4. Scene 2 can be entered from scenes 1 and 4, and while in scene 2 you can flash to scene 3 and then back to scene 2.
In the Windows build, entering from scenes 1 and 3 seem to work perfectly fine. The actionlist runs as intended. But then entering from scene 4 causes the above error. Again, this is only in the build (I haven't tested Mac yet). Any idea what may cause this?
Comments
Open up Scripts/Static/AssetLoader.cs, and insert the following into the top of the RetrieveAsset function (line 39):
if (originalFile == null)
{
return null;
}
If that works, I'll include it in 1.41.